diff --git a/src/common.hpp b/src/common.hpp
index efeabe6..ecd0719 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -26,8 +26,9 @@
 #include <ndn-cxx/data.hpp>
 #include <ndn-cxx/selectors.hpp>
 #include <ndn-cxx/key-locator.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/security/validator.hpp>
+#include <ndn-cxx/security/v2/key-chain.hpp>
+#include <ndn-cxx/security/v2/validator.hpp>
+#include <ndn-cxx/security/validator-config.hpp>
 #include <ndn-cxx/util/time.hpp>
 #include <ndn-cxx/util/scheduler.hpp>
 
@@ -57,9 +58,11 @@
 using ndn::Exclude;
 using ndn::Data;
 using ndn::KeyLocator;
-using ndn::KeyChain;
 using ndn::Scheduler;
-using ndn::Validator;
+using ndn::security::v2::KeyChain;
+using ndn::security::v2::Validator;
+using ndn::security::v2::ValidationError;
+using ndn::security::ValidatorConfig;
 
 using std::shared_ptr;
 using std::make_shared;
diff --git a/src/handles/delete-handle.cpp b/src/handles/delete-handle.cpp
index d062399..5c06015 100644
--- a/src/handles/delete-handle.cpp
+++ b/src/handles/delete-handle.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -33,48 +33,47 @@
 DeleteHandle::onInterest(const Name& prefix, const Interest& interest)
 {
   m_validator.validate(interest, bind(&DeleteHandle::onValidated, this, _1, prefix),
-                       bind(&DeleteHandle::onValidationFailed, this, _1, _2));
+                                 bind(&DeleteHandle::onValidationFailed, this, _1, _2));
 }
 
 void
-DeleteHandle::onValidated(const shared_ptr<const Interest>& interest, const Name& prefix)
+DeleteHandle::onValidated(const Interest& interest, const Name& prefix)
 {
   RepoCommandParameter parameter;
 
   try {
-    extractParameter(*interest, prefix, parameter);
+    extractParameter(interest, prefix, parameter);
   }
   catch (RepoCommandParameter::Error) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
 
   if (parameter.hasSelectors()) {
 
     if (parameter.hasStartBlockId() || parameter.hasEndBlockId()) {
-      negativeReply(*interest, 402);
+      negativeReply(interest, 402);
       return;
     }
 
     //choose data with selector and delete it
-    processSelectorDeleteCommand(*interest, parameter);
+    processSelectorDeleteCommand(interest, parameter);
     return;
   }
 
   if (!parameter.hasStartBlockId() && !parameter.hasEndBlockId()) {
-    processSingleDeleteCommand(*interest, parameter);
+    processSingleDeleteCommand(interest, parameter);
     return;
   }
 
-  processSegmentDeleteCommand(*interest, parameter);
+  processSegmentDeleteCommand(interest, parameter);
 }
 
 void
-DeleteHandle::onValidationFailed(const shared_ptr<const Interest>& interest,
-                                 const std::string& reason)
+DeleteHandle::onValidationFailed(const Interest& interest, const ValidationError& error)
 {
-  std::cerr << reason << std::endl;
-  negativeReply(*interest, 401);
+  std::cerr << error << std::endl;
+  negativeReply(interest, 401);
 }
 //listen change the setinterestfilter
 void
diff --git a/src/handles/delete-handle.hpp b/src/handles/delete-handle.hpp
index 265d5ef..17cb48a 100644
--- a/src/handles/delete-handle.hpp
+++ b/src/handles/delete-handle.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -50,10 +50,10 @@
   onInterest(const Name& prefix, const Interest& interest);
 
   void
-  onValidated(const std::shared_ptr<const Interest>& interest, const Name& prefix);
+  onValidated(const Interest& interest, const Name& prefix);
 
   void
-  onValidationFailed(const std::shared_ptr<const Interest>& interest, const std::string& reason);
+  onValidationFailed(const Interest& interest, const ValidationError& error);
 
   /**
    * @todo delete check has not been realized due to the while loop of segmented data deletion.
diff --git a/src/handles/watch-handle.cpp b/src/handles/watch-handle.cpp
index 91eaac4..bee036f 100644
--- a/src/handles/watch-handle.cpp
+++ b/src/handles/watch-handle.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -53,18 +53,18 @@
 }
 
 void
-WatchHandle::onValidated(const shared_ptr<const Interest>& interest, const Name& prefix)
+WatchHandle::onValidated(const Interest& interest, const Name& prefix)
 {
   RepoCommandParameter parameter;
   try {
-    extractParameter(*interest, prefix, parameter);
+    extractParameter(interest, prefix, parameter);
   }
   catch (RepoCommandParameter::Error) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
 
-  processWatchCommand(*interest, parameter);
+  processWatchCommand(interest, parameter);
 }
 
 void WatchHandle::watchStop(const Name& name)
@@ -79,11 +79,10 @@
 }
 
 void
-WatchHandle::onValidationFailed(const shared_ptr<const Interest>& interest,
-                                const std::string& reason)
+WatchHandle::onValidationFailed(const Interest& interest, const ValidationError& error)
 {
-  std::cerr << reason << std::endl;
-  negativeReply(*interest, 401);
+  std::cerr << error << std::endl;
+  negativeReply(interest, 401);
 }
 
 void
@@ -95,13 +94,12 @@
 }
 
 void
-WatchHandle::onDataValidated(const Interest& interest, const shared_ptr<const Data>& data,
-                             const Name& name)
+WatchHandle::onDataValidated(const Interest& interest, const Data& data, const Name& name)
 {
   if (!m_processes[name].second) {
     return;
   }
-  if (getStorageHandle().insertData(*data)) {
+  if (getStorageHandle().insertData(data)) {
     m_size++;
     if (!onRunning(name))
       return;
@@ -113,7 +111,7 @@
 
     // update selectors
     // if data name is equal to interest name, use MinSuffixComponents selecor to exclude this data
-    if (data->getName().size() == interest.getName().size()) {
+    if (data.getName().size() == interest.getName().size()) {
       fetchInterest.setMinSuffixComponents(2);
     }
     else {
@@ -122,7 +120,7 @@
         exclude = interest.getExclude();
       }
 
-      exclude.excludeBefore(data->getName()[interest.getName().size()]);
+      exclude.excludeBefore(data.getName()[interest.getName().size()]);
       fetchInterest.setExclude(exclude);
     }
 
@@ -139,10 +137,10 @@
 }
 
 void
-WatchHandle::onDataValidationFailed(const Interest& interest, const shared_ptr<const Data>& data,
-                                    const std::string& reason, const Name& name)
+WatchHandle::onDataValidationFailed(const Interest& interest, const Data& data,
+                                    const ValidationError& error, const Name& name)
 {
-  std::cerr << reason << std::endl;
+  std::cerr << error << std::endl;
   if (!m_processes[name].second) {
     return;
   }
@@ -156,7 +154,7 @@
 
   // update selectors
   // if data name is equal to interest name, use MinSuffixComponents selecor to exclude this data
-  if (data->getName().size() == interest.getName().size()) {
+  if (data.getName().size() == interest.getName().size()) {
     fetchInterest.setMinSuffixComponents(2);
   }
   else {
@@ -165,7 +163,7 @@
       exclude = interest.getExclude();
     }
     // Only exclude this data since other data whose names are smaller may be validated and satisfied
-    exclude.excludeBefore(data->getName()[interest.getName().size()]);
+    exclude.excludeBefore(data.getName()[interest.getName().size()]);
     fetchInterest.setExclude(exclude);
   }
 
@@ -219,27 +217,26 @@
 }
 
 void
-WatchHandle::onStopValidated(const shared_ptr<const Interest>& interest, const Name& prefix)
+WatchHandle::onStopValidated(const Interest& interest, const Name& prefix)
 {
   RepoCommandParameter parameter;
   try {
-    extractParameter(*interest, prefix, parameter);
+    extractParameter(interest, prefix, parameter);
   }
   catch (RepoCommandParameter::Error) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
 
   watchStop(parameter.getName());
-  negativeReply(*interest, 101);
+  negativeReply(interest, 101);
 }
 
 void
-WatchHandle::onStopValidationFailed(const shared_ptr<const Interest>& interest,
-                                    const std::string& reason)
+WatchHandle::onStopValidationFailed(const Interest& interest, const ValidationError& error)
 {
-  std::cerr << reason << std::endl;
-  negativeReply(*interest, 401);
+  std::cerr << error << std::endl;
+  negativeReply(interest, 401);
 }
 
 void
@@ -251,26 +248,26 @@
 }
 
 void
-WatchHandle::onCheckValidated(const shared_ptr<const Interest>& interest, const Name& prefix)
+WatchHandle::onCheckValidated(const Interest& interest, const Name& prefix)
 {
   RepoCommandParameter parameter;
   try {
-    extractParameter(*interest, prefix, parameter);
+    extractParameter(interest, prefix, parameter);
   }
   catch (RepoCommandParameter::Error) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
 
   if (!parameter.hasName()) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
   //check whether this process exists
   Name name = parameter.getName();
   if (m_processes.count(name) == 0) {
     std::cerr << "no such process name: " << name << std::endl;
-    negativeReply(*interest, 404);
+    negativeReply(interest, 404);
     return;
   }
 
@@ -279,16 +276,15 @@
     response.setStatusCode(101);
   }
 
-  reply(*interest, response);
+  reply(interest, response);
 
 }
 
 void
-WatchHandle::onCheckValidationFailed(const shared_ptr<const Interest>& interest,
-                                     const std::string& reason)
+WatchHandle::onCheckValidationFailed(const Interest& interest, const ValidationError& error)
 {
-  std::cerr << reason << std::endl;
-  negativeReply(*interest, 401);
+  std::cerr << error << std::endl;
+  negativeReply(interest, 401);
 }
 
 void
diff --git a/src/handles/watch-handle.hpp b/src/handles/watch-handle.hpp
index 5768e06..c7071df 100644
--- a/src/handles/watch-handle.hpp
+++ b/src/handles/watch-handle.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -68,10 +68,10 @@
   onInterest(const Name& prefix, const Interest& interest);
 
   void
-  onValidated(const std::shared_ptr<const Interest>& interest, const Name& prefix);
+  onValidated(const Interest& interest, const Name& prefix);
 
   void
-  onValidationFailed(const std::shared_ptr<const Interest>& interest, const std::string& reason);
+  onValidationFailed(const Interest& interest, const ValidationError& error);
 
 private: // data fetching
   /**
@@ -87,15 +87,14 @@
   onTimeout(const Interest& interest, const Name& name);
 
   void
-  onDataValidated(const Interest& interest, const std::shared_ptr<const Data>& data,
-                  const Name& name);
+  onDataValidated(const Interest& interest, const Data& data, const Name& name);
 
   /**
    * @brief failure of validation
    */
   void
-  onDataValidationFailed(const Interest& interest, const std::shared_ptr<const Data>& data,
-                         const std::string& reason, const Name& name);
+  onDataValidationFailed(const Interest& interest, const Data& data,
+                         const ValidationError& error, const Name& name);
 
 
   void
@@ -112,11 +111,10 @@
   onCheckInterest(const Name& prefix, const Interest& interest);
 
   void
-  onCheckValidated(const std::shared_ptr<const Interest>& interest, const Name& prefix);
+  onCheckValidated(const Interest& interest, const Name& prefix);
 
   void
-  onCheckValidationFailed(const std::shared_ptr<const Interest>& interest,
-                          const std::string& reason);
+  onCheckValidationFailed(const Interest& interest, const ValidationError& error);
 
 private: // watch stop command
   /**
@@ -126,11 +124,10 @@
   onStopInterest(const Name& prefix, const Interest& interest);
 
   void
-  onStopValidated(const std::shared_ptr<const Interest>& interest, const Name& prefix);
+  onStopValidated(const Interest& interest, const Name& prefix);
 
   void
-  onStopValidationFailed(const std::shared_ptr<const Interest>& interest,
-                         const std::string& reason);
+  onStopValidationFailed(const Interest& interest, const ValidationError& error);
 
 private:
   void
diff --git a/src/handles/write-handle.cpp b/src/handles/write-handle.cpp
index a398f0b..4586bad 100644
--- a/src/handles/write-handle.cpp
+++ b/src/handles/write-handle.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -55,38 +55,37 @@
 }
 
 void
-WriteHandle::onValidated(const std::shared_ptr<const Interest>& interest, const Name& prefix)
+WriteHandle::onValidated(const Interest& interest, const Name& prefix)
 {
   //m_validResult = 1;
   RepoCommandParameter parameter;
   try {
-    extractParameter(*interest, prefix, parameter);
+    extractParameter(interest, prefix, parameter);
   }
   catch (RepoCommandParameter::Error) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
 
   if (parameter.hasStartBlockId() || parameter.hasEndBlockId()) {
     if (parameter.hasSelectors()) {
-      negativeReply(*interest, 402);
+      negativeReply(interest, 402);
       return;
     }
-    processSegmentedInsertCommand(*interest, parameter);
+    processSegmentedInsertCommand(interest, parameter);
   }
   else {
-    processSingleInsertCommand(*interest, parameter);
+    processSingleInsertCommand(interest, parameter);
   }
   if (parameter.hasInterestLifetime())
     m_interestLifetime = parameter.getInterestLifetime();
 }
 
 void
-WriteHandle::onValidationFailed(const std::shared_ptr<const Interest>& interest,
-                                const std::string& reason)
+WriteHandle::onValidationFailed(const Interest& interest, const ValidationError& error)
 {
-  std::cerr << reason << std::endl;
-  negativeReply(*interest, 401);
+  std::cerr << error << std::endl;
+  negativeReply(interest, 401);
 }
 
 void
@@ -98,9 +97,7 @@
 }
 
 void
-WriteHandle::onDataValidated(const Interest& interest,
-                             const std::shared_ptr<const Data>& data,
-                             ProcessId processId)
+WriteHandle::onDataValidated(const Interest& interest, const Data& data, ProcessId processId)
 {
   if (m_processes.count(processId) == 0) {
     return;
@@ -110,9 +107,9 @@
   RepoCommandResponse& response = process.response;
 
   if (response.getInsertNum() == 0) {
-    getStorageHandle().insertData(*data);
-   // getStorageHandle().insertEntry(*data);
-   // getStoreIndex().insert(*data);
+    getStorageHandle().insertData(data);
+   // getStorageHandle().insertEntry(data);
+   // getStoreIndex().insert(data);
     response.setInsertNum(1);
   }
 
@@ -120,10 +117,9 @@
 }
 
 void
-WriteHandle::onDataValidationFailed(const std::shared_ptr<const Data>& data,
-                                    const std::string& reason)
+WriteHandle::onDataValidationFailed(const Data& data, const ValidationError& error)
 {
-  std::cerr << reason << std::endl;
+  std::cerr << error << std::endl;
 }
 
 void
@@ -135,9 +131,7 @@
 }
 
 void
-WriteHandle::onSegmentDataValidated(const Interest& interest,
-                                    const std::shared_ptr<const Data>& data,
-                                    ProcessId processId)
+WriteHandle::onSegmentDataValidated(const Interest& interest, const Data& data, ProcessId processId)
 {
   if (m_processes.count(processId) == 0) {
     return;
@@ -145,7 +139,7 @@
   RepoCommandResponse& response = m_processes[processId].response;
 
   //refresh endBlockId
-  Name::Component finalBlockId = data->getFinalBlockId();
+  Name::Component finalBlockId = data.getFinalBlockId();
 
   if (!finalBlockId.empty()) {
     SegmentNo final = finalBlockId.toSegment();
@@ -160,7 +154,7 @@
   }
 
   //insert data
-  if (getStorageHandle().insertData(*data)) {
+  if (getStorageHandle().insertData(data)) {
     response.setInsertNum(response.getInsertNum() + 1);
   }
 
@@ -386,26 +380,26 @@
 }
 
 void
-WriteHandle::onCheckValidated(const shared_ptr<const Interest>& interest, const Name& prefix)
+WriteHandle::onCheckValidated(const Interest& interest, const Name& prefix)
 {
   RepoCommandParameter parameter;
   try {
-    extractParameter(*interest, prefix, parameter);
+    extractParameter(interest, prefix, parameter);
   }
   catch (RepoCommandParameter::Error) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
 
   if (!parameter.hasProcessId()) {
-    negativeReply(*interest, 403);
+    negativeReply(interest, 403);
     return;
   }
   //check whether this process exists
   ProcessId processId = parameter.getProcessId();
   if (m_processes.count(processId) == 0) {
     std::cerr << "no such processId: " << processId << std::endl;
-    negativeReply(*interest, 404);
+    negativeReply(interest, 404);
     return;
   }
 
@@ -416,27 +410,26 @@
   //Check whether it is single data fetching
   if (!response.hasStartBlockId() &&
       !response.hasEndBlockId()) {
-    reply(*interest, response);
+    reply(interest, response);
     return;
   }
 
   //read if noEndtimeout
   if (!response.hasEndBlockId()) {
     extendNoEndTime(process);
-    reply(*interest, response);
+    reply(interest, response);
     return;
   }
   else {
-    reply(*interest, response);
+    reply(interest, response);
   }
 }
 
 void
-WriteHandle::onCheckValidationFailed(const shared_ptr<const Interest>& interest,
-                                     const std::string& reason)
+WriteHandle::onCheckValidationFailed(const Interest& interest, const ValidationError& error)
 {
-  std::cerr << reason << std::endl;
-  negativeReply(*interest, 401);
+  std::cerr << error << std::endl;
+  negativeReply(interest, 401);
 }
 
 void
diff --git a/src/handles/write-handle.hpp b/src/handles/write-handle.hpp
index 1e7a007..c6622d9 100644
--- a/src/handles/write-handle.hpp
+++ b/src/handles/write-handle.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -107,10 +107,10 @@
   onInterest(const Name& prefix, const Interest& interest);
 
   void
-  onValidated(const std::shared_ptr<const Interest>& interest, const Name& prefix);
+  onValidated(const Interest& interest, const Name& prefix);
 
   void
-  onValidationFailed(const std::shared_ptr<const Interest>& interest, const std::string& reason);
+  onValidationFailed(const Interest& interest, const ValidationError& error);
 
 private: // single data fetching
   /**
@@ -120,8 +120,7 @@
   onData(const Interest& interest, const Data& data, ProcessId processId);
 
   void
-  onDataValidated(const Interest& interest, const std::shared_ptr<const Data>& data,
-                  ProcessId processId);
+  onDataValidated(const Interest& interest, const Data& data, ProcessId processId);
 
   /**
    * @brief handle when fetching one data timeout
@@ -140,8 +139,7 @@
   onSegmentData(const Interest& interest, const Data& data, ProcessId processId);
 
   void
-  onSegmentDataValidated(const Interest& interest, const std::shared_ptr<const Data>& data,
-                         ProcessId processId);
+  onSegmentDataValidated(const Interest& interest, const Data& data, ProcessId processId);
 
   /**
    * @brief Timeout when fetching segmented data. Data can be fetched RETRY_TIMEOUT times.
@@ -175,7 +173,7 @@
    * @brief failure of validation for both one or segmented data
    */
   void
-  onDataValidationFailed(const std::shared_ptr<const Data>& data, const std::string& reason);
+  onDataValidationFailed(const Data& data, const ValidationError& error);
 
   /**
    * @brief extends noEndTime of process if not noEndTimeout, set StatusCode 405
@@ -194,11 +192,10 @@
   onCheckInterest(const Name& prefix, const Interest& interest);
 
   void
-  onCheckValidated(const std::shared_ptr<const Interest>& interest, const Name& prefix);
+  onCheckValidated(const Interest& interest, const Name& prefix);
 
   void
-  onCheckValidationFailed(const std::shared_ptr<const Interest>& interest,
-                          const std::string& reason);
+  onCheckValidationFailed(const Interest& interest, const ValidationError& error);
 
 private:
   void
diff --git a/src/repo-command-parameter.hpp b/src/repo-command-parameter.hpp
index 3648679..97208b6 100644
--- a/src/repo-command-parameter.hpp
+++ b/src/repo-command-parameter.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -20,11 +20,12 @@
 #ifndef REPO_REPO_COMMAND_PARAMETER_HPP
 #define REPO_REPO_COMMAND_PARAMETER_HPP
 
+#include "repo-tlv.hpp"
+
 #include <ndn-cxx/encoding/encoding-buffer.hpp>
 #include <ndn-cxx/encoding/block-helpers.hpp>
 #include <ndn-cxx/name.hpp>
 #include <ndn-cxx/selectors.hpp>
-#include "repo-tlv.hpp"
 
 namespace repo {
 
@@ -244,7 +245,7 @@
     return m_hasInterestLifetime;
   }
 
-  template<bool T>
+  template<ndn::encoding::Tag T>
   size_t
   wireEncode(EncodingImpl<T>& block) const;
 
@@ -276,7 +277,7 @@
   mutable Block m_wire;
 };
 
-template<bool T>
+template<ndn::encoding::Tag T>
 inline size_t
 RepoCommandParameter::wireEncode(EncodingImpl<T>& encoder) const
 {
diff --git a/src/repo-command-response.hpp b/src/repo-command-response.hpp
index d8f1fe8..b07d894 100644
--- a/src/repo-command-response.hpp
+++ b/src/repo-command-response.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -20,11 +20,12 @@
 #ifndef REPO_REPO_COMMAND_RESPONSE_HPP
 #define REPO_REPO_COMMAND_RESPONSE_HPP
 
+#include "repo-tlv.hpp"
+
 #include <ndn-cxx/encoding/block.hpp>
 #include <ndn-cxx/encoding/block-helpers.hpp>
 #include <ndn-cxx/encoding/encoding-buffer.hpp>
 #include <ndn-cxx/encoding/tlv-nfd.hpp>
-#include "repo-tlv.hpp"
 
 namespace repo {
 
@@ -194,7 +195,7 @@
     return m_hasDeleteNum;
   }
 
-  template<bool T>
+  template<ndn::encoding::Tag T>
   size_t
   wireEncode(EncodingImpl<T>& block) const;
 
@@ -222,7 +223,7 @@
   mutable Block m_wire;
 };
 
-template<bool T>
+template<ndn::encoding::Tag T>
 inline size_t
 RepoCommandResponse::wireEncode(EncodingImpl<T>& encoder) const
 {
diff --git a/src/repo.cpp b/src/repo.cpp
index e12698f..28a43a0 100644
--- a/src/repo.cpp
+++ b/src/repo.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -118,6 +118,7 @@
   , m_face(ioService)
   , m_store(std::make_shared<SqliteStorage>(config.dbPath))
   , m_storageHandle(config.nMaxPackets, *m_store)
+  , m_validator(m_face)
   , m_readHandle(m_face, m_storageHandle, m_keyChain, m_scheduler)
   , m_writeHandle(m_face, m_storageHandle, m_keyChain, m_scheduler, m_validator)
   , m_watchHandle(m_face, m_storageHandle, m_keyChain, m_scheduler, m_validator)
@@ -167,9 +168,7 @@
 void
 Repo::enableValidation()
 {
-  std::cerr << "Validation is temporarily disabled. All commands will be authorized.\n";
-  /// \todo #4091 restore with ValidatorPolicyConf
-  // m_validator.load(m_config.validatorNode, m_config.repoConfigPath);
+  m_validator.load(m_config.validatorNode, m_config.repoConfigPath);
 }
 
 } // namespace repo
diff --git a/src/repo.hpp b/src/repo.hpp
index ef506a7..382a21e 100644
--- a/src/repo.hpp
+++ b/src/repo.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -32,7 +32,7 @@
 
 #include "common.hpp"
 
-#include <ndn-cxx/security/validator-null.hpp>
+#include <ndn-cxx/security/validator-config.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/property_tree/info_parser.hpp>
 
@@ -86,7 +86,7 @@
   std::shared_ptr<Storage> m_store;
   RepoStorage m_storageHandle;
   KeyChain m_keyChain;
-  ndn::ValidatorNull m_validator;
+  ValidatorConfig m_validator;
   ReadHandle m_readHandle;
   WriteHandle m_writeHandle;
   WatchHandle m_watchHandle;
diff --git a/src/storage/index.cpp b/src/storage/index.cpp
index 3197a70..3eb2cce 100644
--- a/src/storage/index.cpp
+++ b/src/storage/index.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -19,8 +19,8 @@
 
 #include "index.hpp"
 
-#include <ndn-cxx/util/crypto.hpp>
-#include "ndn-cxx/security/signature-sha256-with-rsa.hpp"
+#include <ndn-cxx/util/sha256.hpp>
+#include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
 
 namespace repo {
 
@@ -160,7 +160,7 @@
 Index::computeKeyLocatorHash(const KeyLocator& keyLocator)
 {
   const Block& block = keyLocator.wireEncode();
-  ndn::ConstBufferPtr keyLocatorHash = ndn::crypto::computeSha256Digest(block.wire(), block.size());
+  ndn::ConstBufferPtr keyLocatorHash = ndn::util::Sha256::computeDigest(block.wire(), block.size());
   return keyLocatorHash;
 }
 
@@ -175,7 +175,7 @@
     {
       KeyLocator keyLocator = interest.getPublisherPublicKeyLocator();
       const Block& block = keyLocator.wireEncode();
-      hash = ndn::crypto::computeSha256Digest(block.wire(), block.size());
+      hash = ndn::util::Sha256::computeDigest(block.wire(), block.size());
     }
 
   if (isLeftmost)
diff --git a/src/storage/sqlite-storage.cpp b/src/storage/sqlite-storage.cpp
index 034ae66..3411dfb 100644
--- a/src/storage/sqlite-storage.cpp
+++ b/src/storage/sqlite-storage.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -17,10 +17,11 @@
  * repo-ng, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "../../build/src/config.hpp"
 #include "sqlite-storage.hpp"
+#include "../../build/src/config.hpp"
 #include "index.hpp"
-#include <ndn-cxx/util/crypto.hpp>
+
+#include <ndn-cxx/util/sha256.hpp>
 #include <boost/filesystem.hpp>
 #include <istream>
 
@@ -163,7 +164,7 @@
                         data.wireEncode().size(),0 ) == SQLITE_OK &&
       sqlite3_bind_blob(insertStmt, 4,
                         (const void*)&(*entry.getKeyLocatorHash()),
-                        ndn::crypto::SHA256_DIGEST_SIZE,0) == SQLITE_OK) {
+                        ndn::util::Sha256::DIGEST_SIZE, 0) == SQLITE_OK) {
     rc = sqlite3_step(insertStmt);
     if (rc == SQLITE_CONSTRAINT) {
       std::cerr << "Insert  failed" << std::endl;
