diff --git a/src/mgmt/management-tool.cpp b/src/mgmt/management-tool.cpp
index 186cced..e74c601 100644
--- a/src/mgmt/management-tool.cpp
+++ b/src/mgmt/management-tool.cpp
@@ -35,6 +35,7 @@
 #include <ndn-cxx/encoding/oid.hpp>
 #include <ndn-cxx/security/v1/cryptopp.hpp>
 #include <ndn-cxx/link.hpp>
+#include <ndn-cxx/security/signing-helpers.hpp>
 
 namespace ndn {
 namespace ndns {
@@ -270,11 +271,12 @@
 }
 
 void
-ManagementTool::addRrSet(const Name& zoneName,
-                         const std::string& inFile,
-                         const time::seconds& ttl,
-                         const Name& inputDskCertName,
-                         const ndn::io::IoEncoding encoding)
+ManagementTool::addRrsetFromFile(const Name& zoneName,
+                                 const std::string& inFile,
+                                 const time::seconds& ttl,
+                                 const Name& inputDskCertName,
+                                 const ndn::io::IoEncoding encoding,
+                                 bool needResign)
 {
   //check precondition
   Zone zone(zoneName);
@@ -301,7 +303,7 @@
     }
   }
 
-  //first load the data
+  // load data
   shared_ptr<Data> data;
   if (inFile == DEFAULT_IO)
     data = ndn::io::load<ndn::Data>(std::cin, encoding);
@@ -312,41 +314,8 @@
     throw Error("input does not contain a valid Data packet");
   }
 
-  // determine whether the data is a self-signed certificate
-  shared_ptr<Regex> regex1 = make_shared<Regex>("(<>*)<KEY>(<>+)<ID-CERT><>");
-  if (regex1->match(data->getName())) {
-    IdentityCertificate scert(*data);
-    Name keyName = scert.getPublicKeyName();
-    if (keyName.getPrefix(zoneName.size()) != zoneName) {
-      throw Error("the input key does not belong to the zone");
-    }
-
-    Name keyLocator = scert.getSignature().getKeyLocator().getName();
-
-    // if it is, extract the content and name from the data, and resign it using the dsk.
-    shared_ptr<Regex> regex2 = make_shared<Regex>("(<>*)<KEY>(<>+)<ID-CERT>");
-    BOOST_VERIFY(regex2->match(keyLocator) == true);
-    if (keyName == regex2->expand("\\1\\2")) {
-
-      Name canonicalName;
-      canonicalName
-        .append(zoneName)
-        .append("KEY")
-        .append(keyName.getSubName(zoneName.size(), keyName.size() - zoneName.size()))
-        .append("ID-CERT")
-        .append(data->getName().get(-1));
-
-      if (data->getName() != canonicalName) {
-        // name need to be adjusted
-        auto newData = make_shared<Data>();
-        newData->setName(canonicalName);
-        newData->setMetaInfo(data->getMetaInfo());
-        newData->setContent(data->getContent());
-        m_keyChain.sign(*newData);
-
-        data = newData;
-      }
-    }
+  if (needResign) {
+    m_keyChain.sign(*data, signingByCertificate(dskCertName));
   }
 
   // create response for the input data
