diff --git a/tests/unit-tests/security/certificate-cache-ttl.t.cpp b/tests/unit-tests/security/certificate-cache-ttl.t.cpp
deleted file mode 100644
index 2bf11f4..0000000
--- a/tests/unit-tests/security/certificate-cache-ttl.t.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/certificate-cache-ttl.hpp"
-#include "face.hpp"
-#include "util/time-unit-test-clock.hpp"
-
-#include "boost-test.hpp"
-#include "../unit-test-time-fixture.hpp"
-
-namespace ndn {
-namespace security {
-namespace tests {
-
-using namespace ndn::tests;
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(TestCertificateCacheTtl)
-
-class CertificateCacheFixture : public UnitTestTimeFixture
-{
-public:
-  CertificateCacheFixture()
-    : scheduler(io)
-    , cache(make_shared<CertificateCacheTtl>(ref(io), time::seconds(1)))
-  {
-    cert1 = make_shared<v1::IdentityCertificate>();
-    Name certName1("/tmp/KEY/ksk-1/ID-CERT/1");
-    cert1->setName(certName1);
-    cert1->setFreshnessPeriod(time::milliseconds(500));
-
-    cert2 = make_shared<v1::IdentityCertificate>();
-    Name certName2("/tmp/KEY/ksk-2/ID-CERT/2");
-    cert2->setName(certName2);
-    cert2->setFreshnessPeriod(time::milliseconds(1000));
-
-    name1 = certName1.getPrefix(-1);
-    name2 = certName2.getPrefix(-1);
-  }
-
-public:
-  Scheduler scheduler;
-
-  shared_ptr<CertificateCacheTtl> cache;
-
-  shared_ptr<v1::IdentityCertificate> cert1;
-  shared_ptr<v1::IdentityCertificate> cert2;
-
-  Name name1;
-  Name name2;
-};
-
-BOOST_FIXTURE_TEST_CASE(Expiration, CertificateCacheFixture)
-{
-  cache->insertCertificate(cert1);
-  cache->insertCertificate(cert2);
-
-  advanceClocks(time::nanoseconds(1));
-  BOOST_CHECK_EQUAL(cache->getSize(), 2);
-
-  scheduler.scheduleEvent(time::milliseconds(200), [&] {
-      BOOST_CHECK_EQUAL(cache->getSize(), 2);
-      BOOST_CHECK_EQUAL(static_cast<bool>(cache->getCertificate(name1)), true);
-      BOOST_CHECK_EQUAL(static_cast<bool>(cache->getCertificate(name2)), true);
-    });
-
-  advanceClocks(time::milliseconds(200));
-
-  // cert1 should removed from the cache
-  scheduler.scheduleEvent(time::milliseconds(700), [&] {
-      BOOST_CHECK_EQUAL(static_cast<bool>(cache->getCertificate(name1)), false);
-      BOOST_CHECK_EQUAL(static_cast<bool>(cache->getCertificate(name2)), true);
-    });
-
-  advanceClocks(time::milliseconds(700));
-  BOOST_CHECK_EQUAL(cache->getSize(), 1);
-
-  advanceClocks(time::milliseconds(700));
-  BOOST_CHECK_EQUAL(cache->getSize(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(TtlRefresh, CertificateCacheFixture)
-{
-  cache->insertCertificate(cert1); // 500ms
-
-  advanceClocks(time::nanoseconds(1));
-  BOOST_CHECK_EQUAL(cache->getSize(), 1);
-
-  advanceClocks(time::milliseconds(400));
-  BOOST_CHECK_EQUAL(cache->getSize(), 1);
-
-    // Refresh certificate in cache
-  cache->insertCertificate(cert1); // +500ms
-
-  advanceClocks(time::nanoseconds(1));
-  BOOST_CHECK_EQUAL(cache->getSize(), 1);
-
-  advanceClocks(time::milliseconds(400));
-  BOOST_CHECK_EQUAL(cache->getSize(), 1);
-
-  advanceClocks(time::milliseconds(200));
-  BOOST_CHECK_EQUAL(cache->getSize(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(Reset, CertificateCacheFixture)
-{
-  cache->insertCertificate(cert1);
-  cache->insertCertificate(cert2);
-
-  advanceClocks(time::nanoseconds(1));
-  BOOST_CHECK_EQUAL(cache->getSize(), 2);
-
-  cache->reset();
-
-  advanceClocks(time::nanoseconds(1));
-  BOOST_CHECK_EQUAL(cache->getSize(), 0);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestCertificateCacheTtl
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/command-interest-signer.t.cpp b/tests/unit-tests/security/command-interest-signer.t.cpp
index 33add93..4c95293 100644
--- a/tests/unit-tests/security/command-interest-signer.t.cpp
+++ b/tests/unit-tests/security/command-interest-signer.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -32,7 +32,7 @@
 using namespace ndn::tests;
 
 BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestCommandInterestSigner, IdentityManagementV2TimeFixture)
+BOOST_FIXTURE_TEST_SUITE(TestCommandInterestSigner, IdentityManagementTimeFixture)
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
diff --git a/tests/unit-tests/security/digest-sha256.t.cpp b/tests/unit-tests/security/digest-sha256.t.cpp
index d49b5b4..7855058 100644
--- a/tests/unit-tests/security/digest-sha256.t.cpp
+++ b/tests/unit-tests/security/digest-sha256.t.cpp
@@ -20,7 +20,7 @@
  */
 
 #include "security/digest-sha256.hpp"
-#include "security/validator.hpp"
+#include "security/verification-helpers.hpp"
 #include "util/sha256.hpp"
 #include "util/string-helper.hpp"
 
@@ -28,8 +28,11 @@
 #include "boost-test.hpp"
 
 namespace ndn {
+namespace security {
 namespace tests {
 
+using namespace ndn::tests;
+
 BOOST_AUTO_TEST_SUITE(Security)
 BOOST_FIXTURE_TEST_SUITE(TestDigestSha256, IdentityManagementFixture)
 
@@ -48,16 +51,10 @@
   Data testData(name);
   char content[5] = "1234";
   testData.setContent(reinterpret_cast<uint8_t*>(content), 5);
-
   m_keyChain.sign(testData, security::SigningInfo(security::SigningInfo::SIGNER_TYPE_SHA256));
 
-  testData.wireEncode();
-
-  DigestSha256 sig(testData.getSignature());
-
-  BOOST_CHECK(Validator::verifySignature(testData, sig));
-
-  BOOST_CHECK_THROW(sig.getKeyLocator(), ndn::SignatureInfo::Error);
+  BOOST_CHECK_THROW(testData.getSignature().getKeyLocator(), ndn::SignatureInfo::Error);
+  verifyDigest(testData, DigestAlgorithm::SHA256);
 }
 
 BOOST_AUTO_TEST_CASE(InterestSignature)
@@ -66,17 +63,12 @@
   Interest testInterest(name);
 
   m_keyChain.sign(testInterest, security::SigningInfo(security::SigningInfo::SIGNER_TYPE_SHA256));
-  testInterest.wireEncode();
-  const Name& signedName = testInterest.getName();
-
-  Signature signature(signedName[signed_interest::POS_SIG_INFO].blockFromValue(),
-                      signedName[signed_interest::POS_SIG_VALUE].blockFromValue());
-  DigestSha256 sig(signature);
-  BOOST_CHECK(Validator::verifySignature(testInterest, sig));
+  verifyDigest(testInterest, DigestAlgorithm::SHA256);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestDigestSha256
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
+} // namespace security
 } // namespace ndn
diff --git a/tests/unit-tests/security/v1/certificate.t.cpp b/tests/unit-tests/security/v1/certificate.t.cpp
deleted file mode 100644
index 95188d6..0000000
--- a/tests/unit-tests/security/v1/certificate.t.cpp
+++ /dev/null
@@ -1,387 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/v1/certificate.hpp"
-#include "security/v1/public-key.hpp"
-
-#include "security/v1/cryptopp.hpp"
-
-#include "boost-test.hpp"
-
-namespace ndn {
-namespace security {
-namespace v1 {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V1)
-BOOST_AUTO_TEST_SUITE(TestCertificate)
-
-using namespace CryptoPP;
-
-const uint8_t PUBLIC_KEY[] = {
-  0x30, 0x81, 0x9d, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
-  0x01, 0x05, 0x00, 0x03, 0x81, 0x8b, 0x00, 0x30, 0x81, 0x87, 0x02, 0x81, 0x81, 0x00, 0x9e,
-  0x06, 0x3e, 0x47, 0x85, 0xb2, 0x34, 0x37, 0xaa, 0x85, 0x47, 0xac, 0x03, 0x24, 0x83, 0xb5,
-  0x9c, 0xa8, 0x05, 0x3a, 0x24, 0x1e, 0xeb, 0x89, 0x01, 0xbb, 0xe9, 0x9b, 0xb2, 0xc3, 0x22,
-  0xac, 0x68, 0xe3, 0xf0, 0x6c, 0x02, 0xce, 0x68, 0xa6, 0xc4, 0xd0, 0xa7, 0x06, 0x90, 0x9c,
-  0xaa, 0x1b, 0x08, 0x1d, 0x8b, 0x43, 0x9a, 0x33, 0x67, 0x44, 0x6d, 0x21, 0xa3, 0x1b, 0x88,
-  0x9a, 0x97, 0x5e, 0x59, 0xc4, 0x15, 0x0b, 0xd9, 0x2c, 0xbd, 0x51, 0x07, 0x61, 0x82, 0xad,
-  0xc1, 0xb8, 0xd7, 0xbf, 0x9b, 0xcf, 0x7d, 0x24, 0xc2, 0x63, 0xf3, 0x97, 0x17, 0xeb, 0xfe,
-  0x62, 0x25, 0xba, 0x5b, 0x4d, 0x8a, 0xc2, 0x7a, 0xbd, 0x43, 0x8a, 0x8f, 0xb8, 0xf2, 0xf1,
-  0xc5, 0x6a, 0x30, 0xd3, 0x50, 0x8c, 0xc8, 0x9a, 0xdf, 0xef, 0xed, 0x35, 0xe7, 0x7a, 0x62,
-  0xea, 0x76, 0x7c, 0xbb, 0x08, 0x26, 0xc7, 0x02, 0x01, 0x11
-};
-
-const uint8_t CERT[] = {
-  0x30, 0x81, 0xff, 0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x33, 0x31, 0x32, 0x32, 0x36,
-  0x32, 0x33, 0x32, 0x32, 0x35, 0x34, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x33, 0x31, 0x32,
-  0x32, 0x36, 0x32, 0x33, 0x32, 0x32, 0x35, 0x34, 0x5a, 0x30, 0x12, 0x30, 0x10, 0x06, 0x03,
-  0x55, 0x04, 0x29, 0x13, 0x09, 0x54, 0x45, 0x53, 0x54, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x30,
-  0x81, 0x9d, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
-  0x05, 0x00, 0x03, 0x81, 0x8b, 0x00, 0x30, 0x81, 0x87, 0x02, 0x81, 0x81, 0x00, 0x9e, 0x06,
-  0x3e, 0x47, 0x85, 0xb2, 0x34, 0x37, 0xaa, 0x85, 0x47, 0xac, 0x03, 0x24, 0x83, 0xb5, 0x9c,
-  0xa8, 0x05, 0x3a, 0x24, 0x1e, 0xeb, 0x89, 0x01, 0xbb, 0xe9, 0x9b, 0xb2, 0xc3, 0x22, 0xac,
-  0x68, 0xe3, 0xf0, 0x6c, 0x02, 0xce, 0x68, 0xa6, 0xc4, 0xd0, 0xa7, 0x06, 0x90, 0x9c, 0xaa,
-  0x1b, 0x08, 0x1d, 0x8b, 0x43, 0x9a, 0x33, 0x67, 0x44, 0x6d, 0x21, 0xa3, 0x1b, 0x88, 0x9a,
-  0x97, 0x5e, 0x59, 0xc4, 0x15, 0x0b, 0xd9, 0x2c, 0xbd, 0x51, 0x07, 0x61, 0x82, 0xad, 0xc1,
-  0xb8, 0xd7, 0xbf, 0x9b, 0xcf, 0x7d, 0x24, 0xc2, 0x63, 0xf3, 0x97, 0x17, 0xeb, 0xfe, 0x62,
-  0x25, 0xba, 0x5b, 0x4d, 0x8a, 0xc2, 0x7a, 0xbd, 0x43, 0x8a, 0x8f, 0xb8, 0xf2, 0xf1, 0xc5,
-  0x6a, 0x30, 0xd3, 0x50, 0x8c, 0xc8, 0x9a, 0xdf, 0xef, 0xed, 0x35, 0xe7, 0x7a, 0x62, 0xea,
-  0x76, 0x7c, 0xbb, 0x08, 0x26, 0xc7, 0x02, 0x01, 0x11, 0x30, 0x25, 0x30, 0x23, 0x06, 0x06,
-  0x2b, 0x06, 0x01, 0x05, 0x20, 0x01, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x04, 0x0c,
-  0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2f, 0x6b, 0x69, 0x74, 0x74, 0x79, 0x02, 0x01, 0x00,
-  0x02, 0x01, 0x0a
-};
-
-const std::string CERT_INFO =
-  "Certificate name:\n"
-  "  /\n"
-  "Validity:\n"
-  "  NotBefore: 20131226T232254\n"
-  "  NotAfter: 20131226T232254\n"
-  "Subject Description:\n"
-  "  2.5.4.41: TEST NAME\n"
-  "Public key bits: (RSA)\n"
-  "  MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCeBj5HhbI0N6qFR6wDJIO1nKgF\n"
-  "  OiQe64kBu+mbssMirGjj8GwCzmimxNCnBpCcqhsIHYtDmjNnRG0hoxuImpdeWcQV\n"
-  "  C9ksvVEHYYKtwbjXv5vPfSTCY/OXF+v+YiW6W02Kwnq9Q4qPuPLxxWow01CMyJrf\n"
-  "  7+0153pi6nZ8uwgmxwIB\n"
-  "Signature Information:\n"
-  "  Signature Type: Unknown Signature Type\n";
-
-BOOST_AUTO_TEST_CASE(Encode)
-{
-  Certificate certificate;
-
-  // validity
-  // not before 12/26/2013 @ 11:22pm
-  certificate.setNotBefore(time::fromUnixTimestamp(time::milliseconds(1388100174000LL)));
-  // not after 12/26/2013 @ 11:22pm
-  certificate.setNotAfter(time::fromUnixTimestamp(time::milliseconds(1388100174000LL)));
-
-  // subject
-  certificate.addSubjectDescription(CertificateSubjectDescription(oid::ATTRIBUTE_NAME,
-                                                                  "TEST NAME"));
-
-  // publicKeyInfo
-  PublicKey key(PUBLIC_KEY, sizeof(PUBLIC_KEY));
-  certificate.setPublicKeyInfo(key);
-
-  // extensions
-  BOOST_REQUIRE_NO_THROW({
-    std::string extenstionValue;
-    StringSink sink(extenstionValue);
-    DERSequenceEncoder seq(sink);
-    {
-      std::string name("/hello/kitty");
-      DEREncodeOctetString(seq, reinterpret_cast<const uint8_t*>(name.c_str()), name.size());
-      // trustClass
-      DEREncodeUnsigned<uint32_t>(seq, 0);
-      // trustLevel
-      DEREncodeUnsigned<uint32_t>(seq, 10);
-    }
-    seq.MessageEnd();
-
-    //create a randome extension
-    certificate.addExtension(CertificateExtension(Oid("1.3.6.1.5.32.1"), true,
-      reinterpret_cast<const uint8_t*>(extenstionValue.c_str()),
-      extenstionValue.size()));
-  });
-  // RSA::PublicKey p;
-  // StringSource source(T, sizeof(T), true);
-  // p.Load(source);
-
-  BOOST_REQUIRE_NO_THROW(certificate.encode());
-
-  // ofstream of("cert.out");
-  // of.write((const char*certificate.getContent().value(), certificate.getContent().value_size());
-
-  // const Block &wire = i.wireEncode();
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(CERT, CERT+sizeof(CERT),
-                                  certificate.getContent().value_begin(),
-                                  certificate.getContent().value_end());
-
-  std::ostringstream os;
-  os << certificate;
-  std::string info(os.str());
-
-  BOOST_CHECK_EQUAL(CERT_INFO, info);
-}
-
-const unsigned char REAL_CERT[] = {
-  0x30, 0x82, 0x01, 0x63, 0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x33, 0x31, 0x31, 0x30,
-  0x31, 0x31, 0x37, 0x31, 0x31, 0x32, 0x32, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x34, 0x31,
-  0x31, 0x30, 0x31, 0x31, 0x37, 0x31, 0x31, 0x32, 0x32, 0x5a, 0x30, 0x19, 0x30, 0x17, 0x06,
-  0x03, 0x55, 0x04, 0x29, 0x13, 0x10, 0x4e, 0x44, 0x4e, 0x20, 0x54, 0x65, 0x73, 0x74, 0x62,
-  0x65, 0x64, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x82, 0x01, 0x20, 0x30, 0x0d, 0x06, 0x09,
-  0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0d,
-  0x00, 0x30, 0x82, 0x01, 0x08, 0x02, 0x82, 0x01, 0x01, 0x00, 0xd3, 0xac, 0x7e, 0x7a, 0x5c,
-  0x33, 0x58, 0x21, 0xda, 0xe0, 0x8d, 0xdb, 0xca, 0xb6, 0x02, 0x30, 0x02, 0x15, 0xc5, 0x0a,
-  0x51, 0x54, 0xbb, 0x8e, 0x5e, 0x9d, 0x21, 0xf8, 0x14, 0xbe, 0xe4, 0x63, 0x60, 0x31, 0x53,
-  0xe2, 0xef, 0xee, 0x34, 0xa3, 0x8c, 0xd2, 0x24, 0x6f, 0xa4, 0x89, 0x4f, 0x02, 0x20, 0x7d,
-  0x66, 0xb6, 0x3f, 0x11, 0x40, 0x0c, 0xc1, 0x5f, 0xd8, 0x45, 0x23, 0x95, 0x40, 0xc8, 0xe0,
-  0xbc, 0x9d, 0x2f, 0x03, 0xf1, 0x83, 0x9f, 0x07, 0x0b, 0x76, 0xc9, 0x10, 0xd9, 0x3e, 0x0b,
-  0x75, 0x13, 0x93, 0xe9, 0xc9, 0x85, 0x01, 0x88, 0x36, 0x2e, 0xab, 0xfc, 0xe6, 0x24, 0x32,
-  0xfc, 0xc6, 0x3c, 0x40, 0x97, 0x1a, 0xcc, 0xcd, 0x53, 0xaa, 0x0f, 0xfb, 0xa3, 0xfe, 0xf9,
-  0x24, 0x70, 0x13, 0x3f, 0x4f, 0x5b, 0x7d, 0x43, 0xaa, 0x75, 0x0a, 0x94, 0x72, 0xab, 0xe1,
-  0x8c, 0x45, 0xb5, 0x78, 0x10, 0x01, 0xef, 0x1f, 0xb3, 0x05, 0x6f, 0xa6, 0xc3, 0xac, 0x7f,
-  0x6d, 0xf0, 0x31, 0xc4, 0x83, 0xb3, 0x4f, 0x50, 0x26, 0x92, 0x40, 0x1a, 0xdd, 0xec, 0xfb,
-  0xcb, 0xef, 0x63, 0xfe, 0x41, 0xd8, 0x8d, 0x1f, 0xdc, 0xec, 0xfc, 0x48, 0x95, 0xcc, 0x09,
-  0x1e, 0x30, 0x6e, 0x22, 0x9e, 0x24, 0x97, 0x2e, 0xe6, 0x0c, 0xdf, 0x3d, 0x20, 0x32, 0xaa,
-  0x9c, 0xc9, 0x45, 0x14, 0xaf, 0xaa, 0xf5, 0x17, 0xd2, 0x01, 0x98, 0x33, 0xbe, 0x2a, 0x9f,
-  0x7b, 0x9d, 0x98, 0x7c, 0x54, 0x22, 0xfe, 0x72, 0x72, 0x04, 0xc3, 0x2c, 0xc0, 0x14, 0x0b,
-  0xa9, 0x40, 0x7e, 0x46, 0xa1, 0x75, 0x16, 0x1a, 0x27, 0x9e, 0xf2, 0x82, 0x96, 0xc0, 0x7d,
-  0xaf, 0x18, 0x75, 0xfb, 0xbb, 0xab, 0x16, 0x66, 0xc0, 0xa9, 0xd7, 0x93, 0x4c, 0x48, 0x6d,
-  0xce, 0x0b, 0x88, 0xd4, 0x21, 0x93, 0x84, 0x89, 0x55, 0x05, 0xd5, 0x02, 0x01, 0x11
-};
-
-const std::string REAL_CERT_INFO = "Certificate name:\n"
-  "  /tmp\n"
-  "Validity:\n"
-  "  NotBefore: 20131101T171122\n"
-  "  NotAfter: 20141101T171122\n"
-  "Subject Description:\n"
-  "  2.5.4.41: NDN Testbed Root\n"
-  "Public key bits: (RSA)\n"
-  "  MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEA06x+elwzWCHa4I3byrYC\n"
-  "  MAIVxQpRVLuOXp0h+BS+5GNgMVPi7+40o4zSJG+kiU8CIH1mtj8RQAzBX9hFI5VA\n"
-  "  yOC8nS8D8YOfBwt2yRDZPgt1E5PpyYUBiDYuq/zmJDL8xjxAlxrMzVOqD/uj/vkk\n"
-  "  cBM/T1t9Q6p1CpRyq+GMRbV4EAHvH7MFb6bDrH9t8DHEg7NPUCaSQBrd7PvL72P+\n"
-  "  QdiNH9zs/EiVzAkeMG4iniSXLuYM3z0gMqqcyUUUr6r1F9IBmDO+Kp97nZh8VCL+\n"
-  "  cnIEwyzAFAupQH5GoXUWGiee8oKWwH2vGHX7u6sWZsCp15NMSG3OC4jUIZOEiVUF\n"
-  "  1QIB\n"
-  "Signature Information:\n"
-  "  Signature Type: Unknown Signature Type\n";
-
-const uint8_t SELF_SIGNED_ECDSA_CERT[] = {
-  0x06, 0xfd, 0x01, 0x5b, 0x07, 0x33, 0x08, 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x08, 0x03,
-  0x4b, 0x45, 0x59, 0x08, 0x11, 0x6b, 0x73, 0x6b, 0x2d, 0x31, 0x34, 0x31, 0x36, 0x35, 0x39,
-  0x34, 0x35, 0x35, 0x32, 0x38, 0x32, 0x37, 0x08, 0x07, 0x49, 0x44, 0x2d, 0x43, 0x45, 0x52,
-  0x54, 0x08, 0x09, 0xfd, 0x00, 0x00, 0x01, 0x49, 0xd3, 0x9d, 0x78, 0x00, 0x14, 0x03, 0x18,
-  0x01, 0x02, 0x15, 0xa5, 0x30, 0x81, 0xa2, 0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x34,
-  0x31, 0x31, 0x32, 0x31, 0x31, 0x38, 0x32, 0x39, 0x31, 0x32, 0x5a, 0x18, 0x0f, 0x32, 0x30,
-  0x33, 0x34, 0x31, 0x31, 0x31, 0x36, 0x31, 0x38, 0x32, 0x39, 0x31, 0x32, 0x5a, 0x30, 0x21,
-  0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x29, 0x13, 0x18, 0x2f, 0x65, 0x63, 0x64, 0x73, 0x61,
-  0x2f, 0x6b, 0x73, 0x6b, 0x2d, 0x31, 0x34, 0x31, 0x36, 0x35, 0x39, 0x34, 0x35, 0x35, 0x32,
-  0x38, 0x32, 0x37, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
-  0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04,
-  0x83, 0xe5, 0x81, 0x19, 0xd9, 0xfa, 0x64, 0x40, 0xad, 0x7c, 0x93, 0xfc, 0x15, 0x90, 0x6b,
-  0x38, 0x1e, 0xc5, 0xca, 0xb1, 0x6b, 0x0b, 0x1f, 0x64, 0xbf, 0x48, 0xaa, 0xd0, 0x91, 0x5c,
-  0x24, 0xd6, 0x78, 0x40, 0xfd, 0x95, 0x5d, 0x54, 0x64, 0xe1, 0x2d, 0x0e, 0x98, 0x66, 0x1d,
-  0x7a, 0xb0, 0x61, 0x17, 0x05, 0x26, 0x13, 0x63, 0x25, 0x7c, 0xda, 0x87, 0x11, 0xc9, 0x67,
-  0xcd, 0x12, 0x05, 0xf0, 0x16, 0x2f, 0x1b, 0x01, 0x03, 0x1c, 0x2a, 0x07, 0x28, 0x08, 0x05,
-  0x65, 0x63, 0x64, 0x73, 0x61, 0x08, 0x03, 0x4b, 0x45, 0x59, 0x08, 0x11, 0x6b, 0x73, 0x6b,
-  0x2d, 0x31, 0x34, 0x31, 0x36, 0x35, 0x39, 0x34, 0x35, 0x35, 0x32, 0x38, 0x32, 0x37, 0x08,
-  0x07, 0x49, 0x44, 0x2d, 0x43, 0x45, 0x52, 0x54, 0x17, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00,
-  0x9b, 0xae, 0xf4, 0x87, 0x55, 0xaa, 0x78, 0xbf, 0x00, 0xff, 0x1a, 0xbe, 0x90, 0x46, 0x6e,
-  0xdd, 0xe6, 0x3b, 0x44, 0xfd, 0x41, 0x04, 0x86, 0xcc, 0x6a, 0x8b, 0x5a, 0x25, 0xbb, 0xf1,
-  0x55, 0xcd, 0x02, 0x20, 0x0e, 0x67, 0xd8, 0x86, 0xe8, 0x7c, 0x90, 0x3c, 0x13, 0xfd, 0x36,
-  0x9c, 0xbc, 0xa1, 0xc3, 0x7c, 0xe0, 0x0c, 0x6d, 0x64, 0xac, 0xdb, 0x69, 0x99, 0xde, 0x80,
-  0x35, 0x3f, 0xf4, 0x6a, 0xcd, 0x6f
-};
-
-const std::string SELF_SIGNED_ECDSA_CERT_INFO =
-  "Certificate name:\n"
-  "  /ecdsa/KEY/ksk-1416594552827/ID-CERT/%FD%00%00%01I%D3%9Dx%00\n"
-  "Validity:\n"
-  "  NotBefore: 20141121T182912\n"
-  "  NotAfter: 20341116T182912\n"
-  "Subject Description:\n"
-  "  2.5.4.41: /ecdsa/ksk-1416594552827\n"
-  "Public key bits: (EC)\n"
-  "  MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEg+WBGdn6ZECtfJP8FZBrOB7FyrFr\n"
-  "  Cx9kv0iq0JFcJNZ4QP2VXVRk4S0OmGYderBhFwUmE2MlfNqHEclnzRIF\n"
-  "Signature Information:\n"
-  "  Signature Type: SignatureSha256WithEcdsa\n"
-  "  Key Locator: (Self-Signed) /ecdsa/KEY/ksk-1416594552827/ID-CERT\n";
-
-const uint8_t RSA_CERT[] = {
-  0x06, 0xfd, 0x02, 0xd7, 0x07, 0x38, 0x08, 0x03, 0x6e, 0x64, 0x6e, 0x08, 0x03, 0x4b, 0x45,
-  0x59, 0x08, 0x05, 0x73, 0x69, 0x74, 0x65, 0x31, 0x08, 0x11, 0x6b, 0x73, 0x6b, 0x2d, 0x31,
-  0x34, 0x31, 0x36, 0x34, 0x32, 0x35, 0x33, 0x37, 0x37, 0x30, 0x39, 0x34, 0x08, 0x07, 0x49,
-  0x44, 0x2d, 0x43, 0x45, 0x52, 0x54, 0x08, 0x09, 0xfd, 0x00, 0x00, 0x01, 0x49, 0xc9, 0x8b,
-  0x2e, 0x73, 0x14, 0x03, 0x18, 0x01, 0x02, 0x15, 0xfd, 0x01, 0x61, 0x30, 0x82, 0x01, 0x5d,
-  0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x34, 0x31, 0x31, 0x31, 0x39, 0x31, 0x39, 0x33,
-  0x33, 0x30, 0x32, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x35, 0x31, 0x31, 0x31, 0x39, 0x31,
-  0x39, 0x33, 0x33, 0x30, 0x32, 0x5a, 0x30, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x29,
-  0x13, 0x0a, 0x2f, 0x6e, 0x64, 0x6e, 0x2f, 0x73, 0x69, 0x74, 0x65, 0x31, 0x30, 0x82, 0x01,
-  0x20, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
-  0x00, 0x03, 0x82, 0x01, 0x0d, 0x00, 0x30, 0x82, 0x01, 0x08, 0x02, 0x82, 0x01, 0x01, 0x00,
-  0xb6, 0x54, 0x7e, 0xe8, 0xf2, 0x91, 0x7d, 0xc1, 0x6d, 0xcb, 0x25, 0x44, 0x97, 0x90, 0xdc,
-  0x78, 0x15, 0x0e, 0xef, 0xb5, 0xe7, 0xfd, 0x09, 0x2c, 0xf8, 0xd5, 0x9c, 0x2f, 0xe5, 0xa6,
-  0xae, 0x9d, 0x7e, 0x95, 0x2d, 0xfc, 0xc7, 0xc3, 0x43, 0x46, 0xb0, 0x6f, 0x53, 0xcd, 0xcd,
-  0x6a, 0x29, 0x1d, 0x95, 0xa1, 0x62, 0xcd, 0xa9, 0xf2, 0xf8, 0xe2, 0xfa, 0x8b, 0x5d, 0xfe,
-  0xa1, 0x2b, 0x15, 0x3f, 0x7f, 0x71, 0xe6, 0x3e, 0xb9, 0xb1, 0x29, 0xd1, 0x22, 0x6f, 0x56,
-  0xdf, 0xb6, 0x85, 0xaf, 0xd4, 0xb3, 0x67, 0x8b, 0x94, 0xb8, 0x83, 0xcb, 0x72, 0x86, 0xc4,
-  0xf2, 0x86, 0xb2, 0x7c, 0x94, 0xbc, 0x38, 0x7b, 0x8c, 0x92, 0x86, 0x36, 0x83, 0x0e, 0x11,
-  0x8c, 0x95, 0x49, 0xff, 0xcc, 0x16, 0x62, 0xdb, 0x55, 0x40, 0x7f, 0xc8, 0x8d, 0xe4, 0x3f,
-  0x87, 0x02, 0x87, 0xaf, 0xf6, 0x2f, 0x8a, 0x7d, 0x74, 0x10, 0xd3, 0xbb, 0xa3, 0xfe, 0x5a,
-  0x7b, 0x8f, 0x56, 0x09, 0x8b, 0x49, 0x46, 0x9f, 0x7d, 0x55, 0xa3, 0x4a, 0xe8, 0x22, 0x7b,
-  0x80, 0x8a, 0x6f, 0xde, 0x9f, 0xfb, 0x2f, 0xeb, 0xf7, 0x29, 0x8a, 0x38, 0x67, 0x41, 0xae,
-  0x21, 0x7a, 0xe3, 0x7b, 0x96, 0x1a, 0x90, 0x35, 0x7d, 0x04, 0xaa, 0x4d, 0x9f, 0xe6, 0xd6,
-  0x00, 0x17, 0x4e, 0x02, 0x34, 0x6c, 0x56, 0x3a, 0x81, 0x3c, 0xb4, 0x7f, 0x98, 0x48, 0x22,
-  0xa0, 0x9f, 0x53, 0x35, 0xf9, 0x4e, 0xae, 0x8f, 0xc3, 0xfa, 0x0b, 0x93, 0xd4, 0x55, 0x78,
-  0x05, 0xb0, 0x40, 0x44, 0x48, 0x74, 0xb7, 0x9b, 0x2d, 0x65, 0xf0, 0x3d, 0x2e, 0x87, 0x2b,
-  0x48, 0x29, 0x12, 0x85, 0xf0, 0xaf, 0xc4, 0xdc, 0x73, 0xce, 0x18, 0x8b, 0xd9, 0x4c, 0x60,
-  0x15, 0x51, 0xae, 0x47, 0x1e, 0x2b, 0x54, 0xde, 0xf6, 0xba, 0x77, 0x30, 0x5d, 0x68, 0x9a,
-  0xfb, 0x02, 0x01, 0x11, 0x16, 0x2d, 0x1b, 0x01, 0x01, 0x1c, 0x28, 0x07, 0x26, 0x08, 0x03,
-  0x6e, 0x64, 0x6e, 0x08, 0x03, 0x4b, 0x45, 0x59, 0x08, 0x11, 0x6b, 0x73, 0x6b, 0x2d, 0x31,
-  0x34, 0x31, 0x36, 0x34, 0x32, 0x35, 0x32, 0x39, 0x35, 0x35, 0x34, 0x36, 0x08, 0x07, 0x49,
-  0x44, 0x2d, 0x43, 0x45, 0x52, 0x54, 0x17, 0xfd, 0x01, 0x00, 0x26, 0x40, 0xbc, 0xf0, 0x28,
-  0x12, 0x69, 0x94, 0x11, 0x13, 0xff, 0x47, 0x2c, 0x6b, 0x12, 0xdd, 0xfa, 0x60, 0x92, 0xe9,
-  0x59, 0x10, 0x98, 0xd8, 0x11, 0x2a, 0xf0, 0x25, 0xb0, 0x03, 0xb2, 0xda, 0xd3, 0xb6, 0xa9,
-  0xfb, 0x8b, 0xc3, 0x6f, 0xfb, 0xb4, 0x93, 0x9b, 0x24, 0x9f, 0x7e, 0x63, 0x8a, 0x37, 0xea,
-  0x88, 0x74, 0xac, 0x0c, 0x04, 0x5b, 0xa2, 0x39, 0x0c, 0xa1, 0x9e, 0x0e, 0xa2, 0xd6, 0x74,
-  0xca, 0xc4, 0x92, 0x64, 0x9f, 0xc2, 0x68, 0x56, 0xef, 0xc5, 0x11, 0xe8, 0x7a, 0xf3, 0x21,
-  0xde, 0x88, 0x40, 0x70, 0x2b, 0x44, 0xe0, 0xcb, 0x3b, 0x33, 0xc6, 0x53, 0x65, 0x70, 0x56,
-  0x08, 0xe2, 0x22, 0x70, 0x9e, 0xe0, 0x38, 0x18, 0xa8, 0x7c, 0x7d, 0x09, 0x15, 0xac, 0xf1,
-  0x44, 0x63, 0x5d, 0xd5, 0x59, 0xf4, 0xeb, 0x60, 0x6c, 0x6e, 0x77, 0x36, 0x20, 0x2a, 0xe2,
-  0xd1, 0x2d, 0xa1, 0x7d, 0xd4, 0x6d, 0x29, 0x2d, 0x88, 0xde, 0x9e, 0xf8, 0x64, 0x41, 0x6a,
-  0xeb, 0x9f, 0x3b, 0x52, 0x06, 0xb1, 0x94, 0x09, 0x3b, 0xc9, 0xba, 0xa0, 0x05, 0x31, 0x2d,
-  0x49, 0x17, 0x5b, 0xc1, 0x62, 0xf5, 0x19, 0xce, 0x27, 0x7b, 0xe8, 0x4b, 0xeb, 0x80, 0x36,
-  0xf3, 0xd7, 0xe9, 0x59, 0x22, 0x50, 0x5a, 0x14, 0xb0, 0x1a, 0xa5, 0x6b, 0x33, 0xb2, 0x83,
-  0x72, 0x11, 0xf4, 0xd5, 0xd2, 0x32, 0x93, 0x94, 0xb6, 0x8d, 0xed, 0xcd, 0xce, 0x54, 0x79,
-  0xe8, 0xc3, 0x3c, 0xa8, 0xc6, 0x71, 0xa7, 0x61, 0xba, 0x70, 0x44, 0x94, 0xc9, 0xfc, 0xd0,
-  0x20, 0x00, 0x87, 0xdc, 0xf3, 0x3c, 0x47, 0x1b, 0x4f, 0x91, 0x4c, 0xc7, 0x49, 0xb7, 0xe4,
-  0xe3, 0x84, 0xb7, 0x82, 0x52, 0xec, 0x91, 0xa9, 0x28, 0x38, 0x2d, 0x48, 0x89, 0xc7, 0xcf,
-  0xfa, 0x63, 0x0b, 0xf0, 0x62, 0x51, 0xac, 0xe9, 0xdb, 0xfd, 0x1c
-};
-
-const std::string RSA_CERT_INFO =
-  "Certificate name:\n"
-  "  /ndn/KEY/site1/ksk-1416425377094/ID-CERT/%FD%00%00%01I%C9%8B.s\n"
-  "Validity:\n"
-  "  NotBefore: 20141119T193302\n"
-  "  NotAfter: 20151119T193302\n"
-  "Subject Description:\n"
-  "  2.5.4.41: /ndn/site1\n"
-  "Public key bits: (RSA)\n"
-  "  MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAtlR+6PKRfcFtyyVEl5Dc\n"
-  "  eBUO77Xn/Qks+NWcL+Wmrp1+lS38x8NDRrBvU83NaikdlaFizany+OL6i13+oSsV\n"
-  "  P39x5j65sSnRIm9W37aFr9SzZ4uUuIPLcobE8oayfJS8OHuMkoY2gw4RjJVJ/8wW\n"
-  "  YttVQH/IjeQ/hwKHr/Yvin10ENO7o/5ae49WCYtJRp99VaNK6CJ7gIpv3p/7L+v3\n"
-  "  KYo4Z0GuIXrje5YakDV9BKpNn+bWABdOAjRsVjqBPLR/mEgioJ9TNflOro/D+guT\n"
-  "  1FV4BbBAREh0t5stZfA9LocrSCkShfCvxNxzzhiL2UxgFVGuRx4rVN72uncwXWia\n"
-  "  +wIB\n"
-  "Signature Information:\n"
-  "  Signature Type: SignatureSha256WithRsa\n"
-  "  Key Locator: (Name) /ndn/KEY/ksk-1416425295546/ID-CERT\n";
-
-BOOST_AUTO_TEST_CASE(Decode)
-{
-  ndn::Data data("/tmp");
-  data.setContent(REAL_CERT, sizeof(REAL_CERT));
-
-  Certificate certificate(data);
-
-  std::ostringstream os;
-  os << certificate;
-  std::string info(os.str());
-
-  BOOST_CHECK_EQUAL(REAL_CERT_INFO, info);
-
-
-  ndn::Block selfSignedCertBlock(SELF_SIGNED_ECDSA_CERT, sizeof(SELF_SIGNED_ECDSA_CERT));
-  Certificate selfSignedCert;
-  selfSignedCert.wireDecode(selfSignedCertBlock);
-
-  std::ostringstream selfSignedCertOs;
-  selfSignedCertOs << selfSignedCert;
-  std::string selfSignedCertInfo(selfSignedCertOs.str());
-
-  BOOST_CHECK_EQUAL(SELF_SIGNED_ECDSA_CERT_INFO, selfSignedCertInfo);
-
-
-  ndn::Block rsaCertBlock(RSA_CERT, sizeof(RSA_CERT));
-  Certificate rsaCert;
-  rsaCert.wireDecode(rsaCertBlock);
-
-  std::ostringstream rsaCertOs;
-  rsaCertOs << rsaCert;
-  std::string rsaCertInfo(rsaCertOs.str());
-
-  BOOST_CHECK_EQUAL(RSA_CERT_INFO, rsaCertInfo);
-}
-
-const uint8_t WRONG_CERT[] = { // first byte is wrong and an error will be thrown out
-  0x31, 0x82, 0x01, 0x63, 0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x33, 0x31, 0x31, 0x30,
-  0x31, 0x31, 0x37, 0x31, 0x31, 0x32, 0x32, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x34, 0x31,
-  0x31, 0x30, 0x31, 0x31, 0x37, 0x31, 0x31, 0x32, 0x32, 0x5a, 0x30, 0x19, 0x30, 0x17, 0x06,
-  0x03, 0x55, 0x04, 0x29, 0x13, 0x10, 0x4e, 0x44, 0x4e, 0x20, 0x54, 0x65, 0x73, 0x74, 0x62,
-  0x65, 0x64, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x82, 0x01, 0x20, 0x30, 0x0d, 0x06, 0x09,
-  0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0d,
-  0x00, 0x30, 0x82, 0x01, 0x08, 0x02, 0x82, 0x01, 0x01, 0x00, 0xd3, 0xac, 0x7e, 0x7a, 0x5c,
-  0x33, 0x58, 0x21, 0xda, 0xe0, 0x8d, 0xdb, 0xca, 0xb6, 0x02, 0x30, 0x02, 0x15, 0xc5, 0x0a,
-  0x51, 0x54, 0xbb, 0x8e, 0x5e, 0x9d, 0x21, 0xf8, 0x14, 0xbe, 0xe4, 0x63, 0x60, 0x31, 0x53,
-  0xe2, 0xef, 0xee, 0x34, 0xa3, 0x8c, 0xd2, 0x24, 0x6f, 0xa4, 0x89, 0x4f, 0x02, 0x20, 0x7d,
-  0x66, 0xb6, 0x3f, 0x11, 0x40, 0x0c, 0xc1, 0x5f, 0xd8, 0x45, 0x23, 0x95, 0x40, 0xc8, 0xe0,
-  0xbc, 0x9d, 0x2f, 0x03, 0xf1, 0x83, 0x9f, 0x07, 0x0b, 0x76, 0xc9, 0x10, 0xd9, 0x3e, 0x0b,
-  0x75, 0x13, 0x93, 0xe9, 0xc9, 0x85, 0x01, 0x88, 0x36, 0x2e, 0xab, 0xfc, 0xe6, 0x24, 0x32,
-  0xfc, 0xc6, 0x3c, 0x40, 0x97, 0x1a, 0xcc, 0xcd, 0x53, 0xaa, 0x0f, 0xfb, 0xa3, 0xfe, 0xf9,
-  0x24, 0x70, 0x13, 0x3f, 0x4f, 0x5b, 0x7d, 0x43, 0xaa, 0x75, 0x0a, 0x94, 0x72, 0xab, 0xe1,
-  0x8c, 0x45, 0xb5, 0x78, 0x10, 0x01, 0xef, 0x1f, 0xb3, 0x05, 0x6f, 0xa6, 0xc3, 0xac, 0x7f,
-  0x6d, 0xf0, 0x31, 0xc4, 0x83, 0xb3, 0x4f, 0x50, 0x26, 0x92, 0x40, 0x1a, 0xdd, 0xec, 0xfb,
-  0xcb, 0xef, 0x63, 0xfe, 0x41, 0xd8, 0x8d, 0x1f, 0xdc, 0xec, 0xfc, 0x48, 0x95, 0xcc, 0x09,
-  0x1e, 0x30, 0x6e, 0x22, 0x9e, 0x24, 0x97, 0x2e, 0xe6, 0x0c, 0xdf, 0x3d, 0x20, 0x32, 0xaa,
-  0x9c, 0xc9, 0x45, 0x14, 0xaf, 0xaa, 0xf5, 0x17, 0xd2, 0x01, 0x98, 0x33, 0xbe, 0x2a, 0x9f,
-  0x7b, 0x9d, 0x98, 0x7c, 0x54, 0x22, 0xfe, 0x72, 0x72, 0x04, 0xc3, 0x2c, 0xc0, 0x14, 0x0b,
-  0xa9, 0x40, 0x7e, 0x46, 0xa1, 0x75, 0x16, 0x1a, 0x27, 0x9e, 0xf2, 0x82, 0x96, 0xc0, 0x7d,
-  0xaf, 0x18, 0x75, 0xfb, 0xbb, 0xab, 0x16, 0x66, 0xc0, 0xa9, 0xd7, 0x93, 0x4c, 0x48, 0x6d,
-  0xce, 0x0b, 0x88, 0xd4, 0x21, 0x93, 0x84, 0x89, 0x55, 0x05, 0xd5, 0x02, 0x01, 0x11
-};
-
-BOOST_AUTO_TEST_CASE(DecodeError)
-{
-  ndn::Data data("/tmp");
-  data.setContent(WRONG_CERT, sizeof(WRONG_CERT));
-
-  BOOST_CHECK_THROW(Certificate certificate(data), Certificate::Error);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestCertificate
-BOOST_AUTO_TEST_SUITE_END() // V1
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace v1
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/v1/dummy-keychain.cpp b/tests/unit-tests/security/v1/dummy-keychain.cpp
deleted file mode 100644
index 21db30c..0000000
--- a/tests/unit-tests/security/v1/dummy-keychain.cpp
+++ /dev/null
@@ -1,395 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "dummy-keychain.hpp"
-#include "encoding/buffer-stream.hpp"
-#include "util/io.hpp"
-#include <boost/iostreams/device/array.hpp>
-
-namespace ndn {
-namespace security {
-namespace v1 {
-
-static const uint8_t DUMMY_CERT[] =
-  "Bv0C8Ac4CAVkdW1teQgDa2V5CANLRVkIEWtzay0xNDE4NjAwMzkxMDUwCAdJRC1D"
-  "RVJUCAn9AAABSkssIl4UAxgBAhX9AXMwggFvMCIYDzIwMTQxMjE0MjMzOTUxWhgP"
-  "MjAzNDEyMDkyMzM5NTFaMCUwIwYDVQQpExwvZHVtbXkva2V5L2tzay0xNDE4NjAw"
-  "MzkxMDUwMIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAxUfhv54Jdgeq"
-  "0wmQ/ru9ew/ByCKcQawaZT9Xm9o/sMahwQ9IbNx2Dz4Jkelaxra7+DI0QP3pYctv"
-  "Ykn/jwq5y3cO0LJQB+kf/7FtSKG9qBEv8aqq5hDVteBUKiyUXqDmQzbe+mTcJ9Yd"
-  "D7siF1dhrjnM3KL1xpcXu3QaV5m/I6cKVwYrJxp3JKr6k5pHhxJlPIyUu7oU3kFW"
-  "7bHq2uq4ec9gBXCKwA64IVYVQm1GVDk+V0wr7pw9qD6QNa7eMzrCME6vfM0deSiU"
-  "a4TovUJDQFDsM287kYm3tZu7iuJzmOC63tl4YZdyqyOgnqSrUGE1soNHfLokI13H"
-  "hSwxok7nuQIBERY0GwEBHC8HLQgFZHVtbXkIA2tleQgDS0VZCBFrc2stMTQxODYw"
-  "MDM5MTA1MAgHSUQtQ0VSVBf9AQBLLJoQt9HE93NI3Mv1JCb3ezBCWMwTDnZA+XQV"
-  "UgVSvISJfU/lo2sne0SfGp4KsUhj206CDpuh3q0Th5gKSJeysy/bv66V2m2G8aDn"
-  "OkJ7Ut+2o/QnFpIMJz+oZf2f9Z0Pchocmkv8y4Fj02t8HCuFO1ekEvOcocZvWbKy"
-  "HX+P0OdefPzSC535/rsNHXTzgPsoV+yb13vrm4wPeqPPBs+scQYneIFKkRkGE5PU"
-  "pkncAMBN6iWgmSA2RcjcbmT6utCjJTqWviX1XPQtHoF/hBGC0D/TtQDgwVGGibXB"
-  "zb+klRHvCC/uUIfjU2HrE705kaw8btPhTP5/PMe8YKkk+hjh";
-
-static const uint8_t DUMMY_SIGNATURE[] =
-  {0x17, 0xfd, 0x01, 0x00, 0x93, 0x15, 0x09, 0x49, 0x79, 0x9e, 0xb7, 0x9c, 0xd3, 0xc1, 0xbf, 0x61,
-   0x89, 0xd5, 0xd9, 0xca, 0xf2, 0xb0, 0x14, 0xae, 0x72, 0x7c, 0x1f, 0x8f, 0xf5, 0xb1, 0x70, 0xd6,
-   0x9b, 0x8f, 0xf8, 0xd7, 0x2d, 0xbc, 0x92, 0x6f, 0x7d, 0x77, 0x96, 0x46, 0xea, 0xd4, 0x7d, 0x90,
-   0xbc, 0x7a, 0xeb, 0xe2, 0x03, 0x93, 0xb1, 0xd2, 0x62, 0xec, 0x9d, 0xff, 0x9c, 0x9c, 0x2a, 0x14,
-   0x7d, 0x23, 0xca, 0x29, 0x3d, 0x15, 0x1a, 0x40, 0x42, 0x2c, 0x59, 0x33, 0x8a, 0xf7, 0xc0, 0x6b,
-   0xc4, 0x9c, 0xf3, 0xc4, 0x99, 0xa4, 0x1a, 0x60, 0xf5, 0x28, 0x7d, 0x4c, 0xef, 0x43, 0x7d, 0xbd,
-   0x7d, 0x00, 0x51, 0xee, 0x41, 0xf5, 0x25, 0x80, 0xce, 0xe6, 0x64, 0x4f, 0x75, 0x54, 0xf3, 0xb2,
-   0x99, 0x9a, 0x0f, 0x93, 0x9a, 0x28, 0x1d, 0xfe, 0x12, 0x8a, 0xe0, 0xc1, 0x02, 0xeb, 0xa4, 0x35,
-   0x52, 0x88, 0xac, 0x44, 0x1a, 0x44, 0x82, 0x97, 0x4f, 0x5f, 0xa8, 0xd8, 0x9f, 0x67, 0x38, 0xa8,
-   0x64, 0xb6, 0x62, 0x99, 0xbd, 0x96, 0x3c, 0xf5, 0x86, 0x09, 0x5c, 0x97, 0x6b, 0x8f, 0xae, 0xe0,
-   0x60, 0xe7, 0x23, 0x98, 0x6a, 0xee, 0xc1, 0xb0, 0x14, 0xbe, 0x46, 0x2c, 0xfb, 0xa7, 0x27, 0x73,
-   0xe4, 0xf3, 0x26, 0x33, 0xba, 0x99, 0xd4, 0x01, 0x38, 0xa8, 0xf2, 0x9e, 0x87, 0xe0, 0x71, 0x0b,
-   0x25, 0x44, 0x07, 0x35, 0x88, 0xab, 0x67, 0x27, 0x56, 0x0e, 0xb5, 0xb5, 0xe8, 0x27, 0xb4, 0x49,
-   0xdc, 0xb8, 0x48, 0x31, 0xff, 0x99, 0x48, 0xab, 0x11, 0xb4, 0xa0, 0xdf, 0x8a, 0x6d, 0xff, 0x43,
-   0x69, 0x32, 0xa7, 0xbc, 0x63, 0x9d, 0x0f, 0xe0, 0x95, 0x34, 0x36, 0x25, 0x4b, 0x3e, 0x36, 0xbd,
-   0x81, 0x91, 0x0b, 0x91, 0x9f, 0x3a, 0x04, 0xa2, 0x44, 0x28, 0x19, 0xa1, 0x38, 0x21, 0x4f, 0x25,
-   0x59, 0x8a, 0x48, 0xc2};
-
-const std::string DummyPublicInfo::SCHEME = "pib-dummy";
-const std::string DummyTpm::SCHEME = "tpm-dummy";
-
-NDN_CXX_V1_KEYCHAIN_REGISTER_PIB(DummyPublicInfo, "pib-dummy", "dummy");
-NDN_CXX_V1_KEYCHAIN_REGISTER_TPM(DummyTpm, "tpm-dummy", "dummy");
-
-typedef DummyPublicInfo DummyPublicInfo2;
-typedef DummyTpm DummyTpm2;
-
-NDN_CXX_V1_KEYCHAIN_REGISTER_PIB(DummyPublicInfo2, "pib-dummy2");
-NDN_CXX_V1_KEYCHAIN_REGISTER_TPM(DummyTpm2, "tpm-dummy2");
-
-DummyPublicInfo::DummyPublicInfo(const std::string& locator)
-  : SecPublicInfo(locator)
-{
-}
-
-bool
-DummyPublicInfo::doesIdentityExist(const Name& identityName)
-{
-  return true;
-}
-
-void
-DummyPublicInfo::addIdentity(const Name& identityName)
-{
-}
-
-bool
-DummyPublicInfo::revokeIdentity()
-{
-  return true;
-}
-
-bool
-DummyPublicInfo::doesPublicKeyExist(const Name& keyName)
-{
-  return true;
-}
-
-void
-DummyPublicInfo::addKey(const Name& keyName, const v1::PublicKey& publicKey)
-{
-}
-
-shared_ptr<v1::PublicKey>
-DummyPublicInfo::getPublicKey(const Name& keyName)
-{
-  static shared_ptr<v1::PublicKey> publicKey = nullptr;
-  if (publicKey == nullptr) {
-    typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream;
-    ArrayStream is(reinterpret_cast<const char*>(DUMMY_CERT), sizeof(DUMMY_CERT));
-    auto cert = io::load<v1::IdentityCertificate>(is, io::NO_ENCODING);
-    publicKey = make_shared<v1::PublicKey>(cert->getPublicKeyInfo());
-  }
-
-  return publicKey;
-}
-
-KeyType
-DummyPublicInfo::getPublicKeyType(const Name& keyName)
-{
-  return KeyType::RSA;
-}
-
-bool
-DummyPublicInfo::doesCertificateExist(const Name& certificateName)
-{
-  return true;
-}
-
-void
-DummyPublicInfo::addCertificate(const v1::IdentityCertificate& certificate)
-{
-}
-
-shared_ptr<v1::IdentityCertificate>
-DummyPublicInfo::getCertificate(const Name& certificateName)
-{
-  static shared_ptr<v1::IdentityCertificate> cert = nullptr;
-  if (cert == nullptr) {
-    typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream;
-    ArrayStream is(reinterpret_cast<const char*>(DUMMY_CERT), sizeof(DUMMY_CERT));
-    cert = io::load<v1::IdentityCertificate>(is);
-  }
-
-  return cert;
-}
-
-Name
-DummyPublicInfo::getDefaultIdentity()
-{
-  return "/dummy/key";
-}
-
-Name
-DummyPublicInfo::getDefaultKeyNameForIdentity(const Name& identityName)
-{
-  return "/dummy/key/ksk-1418600391050";
-}
-
-Name
-DummyPublicInfo::getDefaultCertificateNameForKey(const Name& keyName)
-{
-  return "/dummy/key/KEY/ksk-1418600391050/ID-CERT/%FD%00%00%01JK%2C%22%5E";
-}
-
-void
-DummyPublicInfo::getAllIdentities(std::vector<Name>& nameList, bool isDefault)
-{
-  if (isDefault) {
-    nameList.push_back("/dummy");
-  }
-}
-
-void
-DummyPublicInfo::getAllKeyNames(std::vector<Name>& nameList, bool isDefault)
-{
-  if (isDefault) {
-    nameList.push_back("/dummy/key/ksk-1418600391050");
-  }
-}
-
-void
-DummyPublicInfo::getAllKeyNamesOfIdentity(const Name& identity, std::vector<Name>& nameList,
-                                          bool isDefault)
-{
-  if (isDefault) {
-    nameList.push_back("/dummy/key/ksk-1418600391050");
-  }
-}
-
-void
-DummyPublicInfo::getAllCertificateNames(std::vector<Name>& nameList, bool isDefault)
-{
-  if (isDefault) {
-    nameList.push_back("/dummy/key/KEY/ksk-1418600391050/ID-CERT/%FD%00%00%01JK%2C%22%5E");
-  }
-}
-
-void
-DummyPublicInfo::getAllCertificateNamesOfKey(const Name& keyName, std::vector<Name>& nameList,
-                                             bool isDefault)
-{
-  if (isDefault) {
-    nameList.push_back("/dummy/key/KEY/ksk-1418600391050/ID-CERT/%FD%00%00%01JK%2C%22%5E");
-  }
-}
-
-void
-DummyPublicInfo::deleteCertificateInfo(const Name& certificateName)
-{
-}
-
-void
-DummyPublicInfo::deletePublicKeyInfo(const Name& keyName)
-{
-}
-
-void
-DummyPublicInfo::deleteIdentityInfo(const Name& identity)
-{
-}
-
-void
-DummyPublicInfo::setDefaultIdentityInternal(const Name& identityName)
-{
-}
-
-void
-DummyPublicInfo::setDefaultKeyNameForIdentityInternal(const Name& keyName)
-{
-}
-
-void
-DummyPublicInfo::setDefaultCertificateNameForKeyInternal(const Name& certificateName)
-{
-}
-
-void
-DummyPublicInfo::setTpmLocator(const std::string& tpmLocator)
-{
-  m_tpmLocator = tpmLocator;
-}
-
-std::string
-DummyPublicInfo::getTpmLocator()
-{
-  return m_tpmLocator;
-}
-
-std::string
-DummyPublicInfo::getScheme()
-{
-  return DummyPublicInfo::SCHEME;
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-
-DummyTpm::DummyTpm(const std::string& locator)
-  : SecTpm(locator)
-{
-}
-
-void
-DummyTpm::setTpmPassword(const uint8_t* password, size_t passwordLength)
-{
-}
-
-void
-DummyTpm::resetTpmPassword()
-{
-}
-
-void
-DummyTpm::setInTerminal(bool inTerminal)
-{
-}
-
-bool
-DummyTpm::getInTerminal() const
-{
-  return false;
-}
-
-bool
-DummyTpm::isLocked()
-{
-  return false;
-}
-
-bool
-DummyTpm::unlockTpm(const char* password, size_t passwordLength, bool usePassword)
-{
-  return true;
-}
-
-void
-DummyTpm::generateKeyPairInTpm(const Name& keyName, const KeyParams& params)
-{
-}
-
-void
-DummyTpm::deleteKeyPairInTpm(const Name& keyName)
-{
-}
-
-shared_ptr<v1::PublicKey>
-DummyTpm::getPublicKeyFromTpm(const Name& keyName)
-{
-  return nullptr;
-}
-
-Block
-DummyTpm::signInTpm(const uint8_t* data, size_t dataLength, const Name& keyName,
-                    DigestAlgorithm digestAlgorithm)
-{
-  return Block(DUMMY_SIGNATURE, sizeof(DUMMY_SIGNATURE));
-}
-
-ConstBufferPtr
-DummyTpm::decryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName,
-                       bool isSymmetric)
-{
-  BOOST_THROW_EXCEPTION(Error("Not supported"));
-}
-
-ConstBufferPtr
-DummyTpm::encryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName,
-                       bool isSymmetric)
-{
-  BOOST_THROW_EXCEPTION(Error("Not supported"));
-}
-
-void
-DummyTpm::generateSymmetricKeyInTpm(const Name& keyName, const KeyParams& params)
-{
-}
-
-bool
-DummyTpm::doesKeyExistInTpm(const Name& keyName, KeyClass keyClass)
-{
-  return true;
-}
-
-bool
-DummyTpm::generateRandomBlock(uint8_t* res, size_t size)
-{
-  return false;
-}
-
-void
-DummyTpm::addAppToAcl(const Name& keyName, KeyClass keyClass, const std::string& appPath,
-                      AclType acl)
-{
-}
-
-ConstBufferPtr
-DummyTpm::exportPrivateKeyPkcs8FromTpm(const Name& keyName)
-{
-  BOOST_THROW_EXCEPTION(Error("Not supported"));
-}
-
-bool
-DummyTpm::importPrivateKeyPkcs8IntoTpm(const Name& keyName, const uint8_t* buffer,
-                                       size_t bufferSize)
-{
-  return false;
-}
-
-bool
-DummyTpm::importPublicKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buffer, size_t bufferSize)
-{
-  return false;
-}
-
-std::string
-DummyTpm::getScheme()
-{
-  return DummyTpm::SCHEME;
-}
-
-} // namespace v1
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/v1/dummy-keychain.hpp b/tests/unit-tests/security/v1/dummy-keychain.hpp
deleted file mode 100644
index 3fe2101..0000000
--- a/tests/unit-tests/security/v1/dummy-keychain.hpp
+++ /dev/null
@@ -1,205 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_TESTS_SECURITY_V1_DUMMY_KEYCHAIN_HPP
-#define NDN_TESTS_SECURITY_V1_DUMMY_KEYCHAIN_HPP
-
-#include "security/v1/key-chain.hpp"
-
-namespace ndn {
-namespace security {
-namespace v1 {
-
-class DummyPublicInfo : public SecPublicInfo
-{
-public:
-  explicit
-  DummyPublicInfo(const std::string& locator);
-
-  virtual bool
-  doesIdentityExist(const Name& identityName);
-
-  virtual void
-  addIdentity(const Name& identityName);
-
-  virtual bool
-  revokeIdentity();
-
-  virtual bool
-  doesPublicKeyExist(const Name& keyName);
-
-  virtual void
-  addKey(const Name& keyName, const v1::PublicKey& publicKey);
-
-  virtual shared_ptr<v1::PublicKey>
-  getPublicKey(const Name& keyName);
-
-  virtual KeyType
-  getPublicKeyType(const Name& keyName);
-
-  virtual bool
-  doesCertificateExist(const Name& certificateName);
-
-  virtual void
-  addCertificate(const v1::IdentityCertificate& certificate);
-
-  virtual shared_ptr<v1::IdentityCertificate>
-  getCertificate(const Name& certificateName);
-
-  virtual Name
-  getDefaultIdentity();
-
-  virtual Name
-  getDefaultKeyNameForIdentity(const Name& identityName);
-
-  virtual Name
-  getDefaultCertificateNameForKey(const Name& keyName);
-
-  virtual void
-  getAllIdentities(std::vector<Name>& nameList, bool isDefault);
-
-  virtual void
-  getAllKeyNames(std::vector<Name>& nameList, bool isDefault);
-
-  virtual void
-  getAllKeyNamesOfIdentity(const Name& identity, std::vector<Name>& nameList, bool isDefault);
-
-  virtual void
-  getAllCertificateNames(std::vector<Name>& nameList, bool isDefault);
-
-  virtual void
-  getAllCertificateNamesOfKey(const Name& keyName, std::vector<Name>& nameList, bool isDefault);
-
-  virtual void
-  deleteCertificateInfo(const Name& certificateName);
-
-  virtual void
-  deletePublicKeyInfo(const Name& keyName);
-
-  virtual void
-  deleteIdentityInfo(const Name& identity);
-
-  virtual void
-  setTpmLocator(const std::string& tpmLocator);
-
-  virtual std::string
-  getTpmLocator();
-
-protected:
-  virtual void
-  setDefaultIdentityInternal(const Name& identityName);
-
-  virtual void
-  setDefaultKeyNameForIdentityInternal(const Name& keyName);
-
-  virtual void
-  setDefaultCertificateNameForKeyInternal(const Name& certificateName);
-
-  virtual std::string
-  getScheme();
-
-public:
-  static const std::string SCHEME;
-
-private:
-  std::string m_tpmLocator;
-};
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-
-class DummyTpm : public SecTpm
-{
-public:
-  explicit
-  DummyTpm(const std::string& locator);
-
-  virtual void
-  setTpmPassword(const uint8_t* password, size_t passwordLength);
-
-  virtual void
-  resetTpmPassword();
-
-  virtual void
-  setInTerminal(bool inTerminal);
-
-  virtual bool
-  getInTerminal() const;
-
-  virtual bool
-  isLocked();
-
-  virtual bool
-  unlockTpm(const char* password, size_t passwordLength, bool usePassword);
-
-  virtual void
-  generateKeyPairInTpm(const Name& keyName, const KeyParams& params);
-
-  virtual void
-  deleteKeyPairInTpm(const Name& keyName);
-
-  virtual shared_ptr<v1::PublicKey>
-  getPublicKeyFromTpm(const Name& keyName);
-
-  virtual Block
-  signInTpm(const uint8_t* data, size_t dataLength, const Name& keyName,
-            DigestAlgorithm digestAlgorithm);
-
-  virtual ConstBufferPtr
-  decryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, bool isSymmetric);
-
-  virtual ConstBufferPtr
-  encryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, bool isSymmetric);
-
-  virtual void
-  generateSymmetricKeyInTpm(const Name& keyName, const KeyParams& params);
-
-  virtual bool
-  doesKeyExistInTpm(const Name& keyName, KeyClass keyClass);
-
-  virtual bool
-  generateRandomBlock(uint8_t* res, size_t size);
-
-  virtual void
-  addAppToAcl(const Name& keyName, KeyClass keyClass, const std::string& appPath, AclType acl);
-
-  virtual std::string
-  getScheme();
-
-protected:
-  virtual ConstBufferPtr
-  exportPrivateKeyPkcs8FromTpm(const Name& keyName);
-
-  virtual bool
-  importPrivateKeyPkcs8IntoTpm(const Name& keyName, const uint8_t* buffer, size_t bufferSize);
-
-  virtual bool
-  importPublicKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buffer, size_t bufferSize);
-
-public:
-  static const std::string SCHEME;
-};
-
-} // namespace v1
-} // namespace security
-} // namespace ndn
-
-#endif // NDN_TESTS_SECURITY_V1_DUMMY_KEYCHAIN_HPP
diff --git a/tests/unit-tests/security/v1/key-chain.t.cpp b/tests/unit-tests/security/v1/key-chain.t.cpp
deleted file mode 100644
index 0ae3cc3..0000000
--- a/tests/unit-tests/security/v1/key-chain.t.cpp
+++ /dev/null
@@ -1,430 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/v1/key-chain.hpp"
-#include "security/validator.hpp"
-#include "security/signing-helpers.hpp"
-
-#include "boost-test.hpp"
-#include "dummy-keychain.hpp"
-#include "../../test-home-env-saver.hpp"
-#include "test-home-fixture.hpp"
-#include "identity-management-fixture.hpp"
-
-#include <boost/algorithm/string.hpp>
-#include <boost/filesystem.hpp>
-#include <cstdlib>
-
-namespace ndn {
-namespace security {
-namespace v1 {
-namespace tests {
-
-using namespace ndn::tests;
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V1)
-BOOST_FIXTURE_TEST_SUITE(TestKeyChain, TestHomeEnvSaver)
-
-template<class Path>
-class TestHomeAndPibFixture : public TestHomeFixture<Path>
-{
-public:
-  TestHomeAndPibFixture()
-  {
-    unsetenv("NDN_CLIENT_PIB");
-    unsetenv("NDN_CLIENT_TPM");
-  }
-};
-
-struct PibPathSqlite3File
-{
-  const std::string PATH = "build/keys-sqlite3-file/";
-};
-
-BOOST_FIXTURE_TEST_CASE(ConstructorNormalConfig, TestHomeAndPibFixture<PibPathSqlite3File>)
-{
-  createClientConf({"pib=pib-sqlite3:%PATH%", "tpm=tpm-file:%PATH%"});
-
-  BOOST_REQUIRE_NO_THROW(KeyChain());
-
-  KeyChain keyChain;
-  BOOST_CHECK_EQUAL(keyChain.getPib().getPibLocator(), "pib-sqlite3:" + m_pibDir);
-  BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-file:" + m_pibDir);
-  BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-file:" + m_pibDir);
-}
-
-struct PibPathSqlite3Empty
-{
-  const std::string PATH = "build/keys-sqlite3-empty/";
-};
-
-BOOST_FIXTURE_TEST_CASE(ConstructorEmptyConfig, TestHomeAndPibFixture<PibPathSqlite3Empty>)
-{
-  createClientConf({"pib=pib-sqlite3:%PATH%"});
-
-#if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS)
-  std::string oldHOME;
-  if (std::getenv("OLD_HOME"))
-    oldHOME = std::getenv("OLD_HOME");
-
-  std::string HOME;
-  if (std::getenv("HOME"))
-    HOME = std::getenv("HOME");
-
-  if (!oldHOME.empty())
-    setenv("HOME", oldHOME.c_str(), true);
-  else
-    unsetenv("HOME");
-#endif
-
-  BOOST_REQUIRE_NO_THROW(KeyChain());
-  KeyChain keyChain;
-  BOOST_CHECK_EQUAL(keyChain.getPib().getPibLocator(), "pib-sqlite3:" + m_pibDir);
-
-#if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS)
-  BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-osxkeychain:");
-  BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-osxkeychain:");
-#else
-  BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-file:");
-  BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-file:");
-#endif
-
-#if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS)
-  if (!HOME.empty())
-    setenv("HOME", HOME.c_str(), true);
-  else
-    unsetenv("HOME");
-#endif
-}
-
-struct PibPathEmptyFile
-{
-  const std::string PATH = "build/keys-empty-file/";
-};
-
-BOOST_FIXTURE_TEST_CASE(ConstructorEmpty2Config, TestHomeAndPibFixture<PibPathEmptyFile>)
-{
-  createClientConf({"tpm=tpm-file:%PATH%"});
-
-  BOOST_REQUIRE_NO_THROW(KeyChain());
-
-  KeyChain keyChain;
-  BOOST_CHECK_EQUAL(keyChain.getPib().getPibLocator(), "pib-sqlite3:");
-  BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-file:" + m_pibDir);
-  BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-file:" + m_pibDir);
-}
-
-BOOST_FIXTURE_TEST_CASE(ConstructorMalConfig, TestHomeAndPibFixture<DefaultPibDir>)
-{
-  createClientConf({"pib=lord", "tpm=ring"});
-
-  BOOST_REQUIRE_THROW(KeyChain(), KeyChain::Error); // Wrong configuration. Error expected.
-}
-
-BOOST_FIXTURE_TEST_CASE(ConstructorMal2Config, TestHomeAndPibFixture<DefaultPibDir>)
-{
-  createClientConf({"pib=pib-sqlite3:%PATH%", "tpm=just-wrong"});
-  BOOST_REQUIRE_THROW(KeyChain(), KeyChain::Error); // Wrong configuration. Error expected.
-}
-
-BOOST_FIXTURE_TEST_CASE(ExportIdentity, IdentityManagementV1Fixture)
-{
-  Name identity("/TestKeyChain/ExportIdentity/");
-  identity.appendVersion();
-  addIdentity(identity);
-
-  shared_ptr<SecuredBag> exported = m_keyChain.exportIdentity(identity, "1234");
-
-  Block block = exported->wireEncode();
-
-  Name keyName = m_keyChain.getDefaultKeyNameForIdentity(identity);
-  Name certName = m_keyChain.getDefaultCertificateNameForKey(keyName);
-
-  m_keyChain.deleteIdentity(identity);
-
-  BOOST_CHECK_EQUAL(m_keyChain.doesIdentityExist(identity), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName), false);
-
-  SecuredBag imported;
-  imported.wireDecode(block);
-  m_keyChain.importIdentity(imported, "1234");
-
-  BOOST_CHECK(m_keyChain.doesIdentityExist(identity));
-  BOOST_CHECK(m_keyChain.doesPublicKeyExist(keyName));
-  BOOST_CHECK(m_keyChain.doesKeyExistInTpm(keyName, KeyClass::PRIVATE));
-  BOOST_CHECK(m_keyChain.doesKeyExistInTpm(keyName, KeyClass::PUBLIC));
-  BOOST_CHECK(m_keyChain.doesCertificateExist(certName));
-}
-
-BOOST_FIXTURE_TEST_CASE(PrepareIdentityCertificate, IdentityManagementV1Fixture)
-{
-  Name identity("/TestKeyChain/PrepareIdentityCertificate/");
-  identity.appendVersion();
-  addIdentity(identity);
-
-  std::vector<v1::CertificateSubjectDescription> subjectDescription;
-  Name lowerIdentity = identity;
-  lowerIdentity.append("Lower").appendVersion();
-  Name lowerKeyName = m_keyChain.generateRsaKeyPair(lowerIdentity, true);
-  shared_ptr<v1::IdentityCertificate> idCert =
-    m_keyChain.prepareUnsignedIdentityCertificate(lowerKeyName, identity,
-                                                  time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(365),
-                                                  subjectDescription);
-  BOOST_CHECK(static_cast<bool>(idCert));
-  BOOST_CHECK_EQUAL(idCert->getName().getPrefix(5),
-                    Name().append(identity).append("KEY").append("Lower"));
-  BOOST_CHECK(idCert->getFreshnessPeriod() >= time::milliseconds::zero());
-
-  shared_ptr<v1::IdentityCertificate> idCert11 =
-    m_keyChain.prepareUnsignedIdentityCertificate(lowerKeyName, identity,
-                                                  time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(365),
-                                                  subjectDescription,
-                                                  lowerIdentity);
-  BOOST_CHECK(static_cast<bool>(idCert11));
-  BOOST_CHECK_EQUAL(idCert11->getName().getPrefix(6),
-              Name().append(lowerIdentity).append("KEY"));
-
-  Name anotherIdentity("/TestKeyChain/PrepareIdentityCertificate/Another/");
-  anotherIdentity.appendVersion();
-  Name anotherKeyName = m_keyChain.generateRsaKeyPair(anotherIdentity, true);
-  shared_ptr<v1::IdentityCertificate> idCert2 =
-    m_keyChain.prepareUnsignedIdentityCertificate(anotherKeyName, identity,
-                                                  time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(365),
-                                                  subjectDescription);
-  BOOST_CHECK(static_cast<bool>(idCert2));
-  BOOST_CHECK_EQUAL(idCert2->getName().getPrefix(5), Name().append(anotherIdentity).append("KEY"));
-
-
-  Name wrongKeyName1;
-  shared_ptr<v1::IdentityCertificate> idCert3 =
-    m_keyChain.prepareUnsignedIdentityCertificate(wrongKeyName1, identity,
-                                                  time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(365),
-                                                  subjectDescription);
-  BOOST_CHECK_EQUAL(static_cast<bool>(idCert3), false);
-
-
-  Name wrongKeyName2("/TestKeyChain/PrepareIdentityCertificate");
-  shared_ptr<v1::IdentityCertificate> idCert4 =
-    m_keyChain.prepareUnsignedIdentityCertificate(wrongKeyName2, identity,
-                                                  time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(365),
-                                                  subjectDescription);
-  BOOST_CHECK_EQUAL(static_cast<bool>(idCert4), false);
-
-
-  Name wrongKeyName3("/TestKeyChain/PrepareIdentityCertificate/ksk-1234");
-  shared_ptr<v1::IdentityCertificate> idCert5 =
-    m_keyChain.prepareUnsignedIdentityCertificate(wrongKeyName3, identity,
-                                                  time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(365),
-                                                  subjectDescription);
-  BOOST_CHECK_EQUAL(static_cast<bool>(idCert5), false);
-}
-
-BOOST_FIXTURE_TEST_CASE(Delete, IdentityManagementV1Fixture)
-{
-  Name identity("/TestSecPublicInfoSqlite3/Delete");
-  identity.appendVersion();
-
-  Name certName1;
-  BOOST_REQUIRE_NO_THROW(certName1 = m_keyChain.createIdentity(identity));
-
-  Name keyName1 = v1::IdentityCertificate::certificateNameToPublicKeyName(certName1);
-  Name keyName2;
-  BOOST_REQUIRE_NO_THROW(keyName2 = m_keyChain.generateRsaKeyPairAsDefault(identity));
-
-  shared_ptr<v1::IdentityCertificate> cert2;
-  BOOST_REQUIRE_NO_THROW(cert2 = m_keyChain.selfSign(keyName2));
-  Name certName2 = cert2->getName();
-  BOOST_REQUIRE_NO_THROW(m_keyChain.addCertificateAsKeyDefault(*cert2));
-
-  Name keyName3;
-  BOOST_REQUIRE_NO_THROW(keyName3 = m_keyChain.generateRsaKeyPairAsDefault(identity));
-
-  shared_ptr<v1::IdentityCertificate> cert3;
-  BOOST_REQUIRE_NO_THROW(cert3 = m_keyChain.selfSign(keyName3));
-  Name certName3 = cert3->getName();
-  BOOST_REQUIRE_NO_THROW(m_keyChain.addCertificateAsKeyDefault(*cert3));
-  shared_ptr<v1::IdentityCertificate> cert4;
-  BOOST_REQUIRE_NO_THROW(cert4 = m_keyChain.selfSign(keyName3));
-  Name certName4 = cert4->getName();
-  BOOST_REQUIRE_NO_THROW(m_keyChain.addCertificateAsKeyDefault(*cert4));
-  shared_ptr<v1::IdentityCertificate> cert5;
-  BOOST_REQUIRE_NO_THROW(cert5 = m_keyChain.selfSign(keyName3));
-  Name certName5 = cert5->getName();
-  BOOST_REQUIRE_NO_THROW(m_keyChain.addCertificateAsKeyDefault(*cert5));
-
-  BOOST_CHECK_EQUAL(m_keyChain.doesIdentityExist(identity), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName1), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName2), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName3), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName1), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName2), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName3), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName4), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName5), true);
-
-  BOOST_REQUIRE_NO_THROW(m_keyChain.deleteCertificate(certName5));
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName5), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName3), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName4), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName3), true);
-
-  BOOST_REQUIRE_NO_THROW(m_keyChain.deleteKey(keyName3));
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName4), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName3), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName3), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName2), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName1), true);
-  BOOST_CHECK_EQUAL(m_keyChain.doesIdentityExist(identity), true);
-
-  BOOST_REQUIRE_NO_THROW(m_keyChain.deleteIdentity(identity));
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName2), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName2), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName1), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesPublicKeyExist(keyName1), false);
-  BOOST_CHECK_EQUAL(m_keyChain.doesIdentityExist(identity), false);
-}
-
-BOOST_AUTO_TEST_CASE(KeyChainWithCustomTpmAndPib)
-{
-  BOOST_REQUIRE_NO_THROW((KeyChain("pib-dummy", "tpm-dummy")));
-  BOOST_REQUIRE_NO_THROW((KeyChain("pib-dummy2", "tpm-dummy2")));
-  BOOST_REQUIRE_NO_THROW((KeyChain("dummy", "dummy")));
-  BOOST_REQUIRE_NO_THROW((KeyChain("dummy:", "dummy:")));
-  BOOST_REQUIRE_NO_THROW((KeyChain("dummy:/something", "dummy:/something")));
-
-  KeyChain keyChain("dummy", "dummy");
-  BOOST_CHECK_EQUAL(keyChain.getPib().getPibLocator(), "pib-dummy:");
-  BOOST_CHECK_EQUAL(keyChain.getPib().getTpmLocator(), "tpm-dummy:");
-  BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-dummy:");
-  BOOST_CHECK_EQUAL(keyChain.getDefaultIdentity(), "/dummy/key");
-}
-
-BOOST_FIXTURE_TEST_CASE(GeneralSigningInterface, IdentityManagementV1Fixture)
-{
-  Name id("/id");
-  Name certName = m_keyChain.createIdentity(id);
-  shared_ptr<v1::IdentityCertificate> idCert = m_keyChain.getCertificate(certName);
-  Name keyName = idCert->getPublicKeyName();
-  m_keyChain.setDefaultIdentity(id);
-
-  Name id2("/id2");
-  Name cert2Name = m_keyChain.createIdentity(id2);
-  shared_ptr<v1::IdentityCertificate> id2Cert = m_keyChain.getCertificate(cert2Name);
-
-  // SigningInfo is set to default
-  Data data1("/data1");
-  m_keyChain.sign(data1);
-  BOOST_CHECK(Validator::verifySignature(data1, idCert->getPublicKeyInfo()));
-  BOOST_CHECK_EQUAL(data1.getSignature().getKeyLocator().getName(), certName.getPrefix(-1));
-
-  Interest interest1("/interest1");
-  m_keyChain.sign(interest1);
-  BOOST_CHECK(Validator::verifySignature(interest1, idCert->getPublicKeyInfo()));
-  SignatureInfo sigInfo1(interest1.getName()[-2].blockFromValue());
-  BOOST_CHECK_EQUAL(sigInfo1.getKeyLocator().getName(), certName.getPrefix(-1));
-
-  // SigningInfo is set to Identity
-  Data data2("/data2");
-  m_keyChain.sign(data2, SigningInfo(SigningInfo::SIGNER_TYPE_ID, id2));
-  BOOST_CHECK(Validator::verifySignature(data2, id2Cert->getPublicKeyInfo()));
-  BOOST_CHECK_EQUAL(data2.getSignature().getKeyLocator().getName(), cert2Name.getPrefix(-1));
-
-  Interest interest2("/interest2");
-  m_keyChain.sign(interest2, SigningInfo(SigningInfo::SIGNER_TYPE_ID, id2));
-  BOOST_CHECK(Validator::verifySignature(interest2, id2Cert->getPublicKeyInfo()));
-  SignatureInfo sigInfo2(interest2.getName()[-2].blockFromValue());
-  BOOST_CHECK_EQUAL(sigInfo2.getKeyLocator().getName(), cert2Name.getPrefix(-1));
-
-  // SigningInfo is set to Key
-  Data data3("/data3");
-  m_keyChain.sign(data3, SigningInfo(SigningInfo::SIGNER_TYPE_KEY, keyName));
-  BOOST_CHECK(Validator::verifySignature(data3, idCert->getPublicKeyInfo()));
-  BOOST_CHECK_EQUAL(data3.getSignature().getKeyLocator().getName(), certName.getPrefix(-1));
-
-  Interest interest3("/interest3");
-  m_keyChain.sign(interest3);
-  BOOST_CHECK(Validator::verifySignature(interest3, idCert->getPublicKeyInfo()));
-  SignatureInfo sigInfo3(interest1.getName()[-2].blockFromValue());
-  BOOST_CHECK_EQUAL(sigInfo3.getKeyLocator().getName(), certName.getPrefix(-1));
-
-  // SigningInfo is set to Cert
-  Data data4("/data4");
-  m_keyChain.sign(data4, SigningInfo(SigningInfo::SIGNER_TYPE_CERT, certName));
-  BOOST_CHECK(Validator::verifySignature(data4, idCert->getPublicKeyInfo()));
-  BOOST_CHECK_EQUAL(data4.getSignature().getKeyLocator().getName(), certName.getPrefix(-1));
-
-  Interest interest4("/interest4");
-  m_keyChain.sign(interest4, SigningInfo(SigningInfo::SIGNER_TYPE_CERT, certName));
-  BOOST_CHECK(Validator::verifySignature(interest4, idCert->getPublicKeyInfo()));
-  SignatureInfo sigInfo4(interest4.getName()[-2].blockFromValue());
-  BOOST_CHECK_EQUAL(sigInfo4.getKeyLocator().getName(), certName.getPrefix(-1));
-
-
-  // SigningInfo is set to DigestSha256
-  Data data5("/data5");
-  m_keyChain.sign(data5, SigningInfo(SigningInfo::SIGNER_TYPE_SHA256));
-  BOOST_CHECK(Validator::verifySignature(data5, DigestSha256(data5.getSignature())));
-
-  Interest interest5("/interest4");
-  m_keyChain.sign(interest5, SigningInfo(SigningInfo::SIGNER_TYPE_SHA256));
-  BOOST_CHECK(Validator::verifySignature(interest5,
-                                         DigestSha256(Signature(interest5.getName()[-2].blockFromValue(),
-                                                                interest5.getName()[-1].blockFromValue()))));
-}
-
-BOOST_FIXTURE_TEST_CASE(EcdsaSigningByIdentityNoCert, IdentityManagementV1Fixture)
-{
-  Data data("/test/data");
-
-  Name nonExistingIdentity = Name("/non-existing/identity").appendVersion();
-
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(data, signingByIdentity(nonExistingIdentity)));
-  BOOST_CHECK_EQUAL(data.getSignature().getType(),
-                    KeyChain::getSignatureType(KeyChain::DEFAULT_KEY_PARAMS.getKeyType(),
-                                               DigestAlgorithm::SHA256));
-  BOOST_CHECK(nonExistingIdentity.isPrefixOf(data.getSignature().getKeyLocator().getName()));
-
-  Name ecIdentity = Name("/ndn/test/ec").appendVersion();
-  Name ecKeyName = m_keyChain.generateEcKeyPairAsDefault(ecIdentity, false, 256);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(data, signingByIdentity(ecIdentity)));
-  BOOST_CHECK_EQUAL(data.getSignature().getType(),
-                    KeyChain::getSignatureType(EcKeyParams().getKeyType(), DigestAlgorithm::SHA256));
-  BOOST_CHECK(ecIdentity.isPrefixOf(data.getSignature().getKeyLocator().getName()));
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestKeyChain
-BOOST_AUTO_TEST_SUITE_END() // V1
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace v1
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/v1/public-key.t.cpp b/tests/unit-tests/security/v1/public-key.t.cpp
deleted file mode 100644
index 41ee7d6..0000000
--- a/tests/unit-tests/security/v1/public-key.t.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/v1/public-key.hpp"
-#include "security/v1/cryptopp.hpp"
-#include "encoding/buffer-stream.hpp"
-
-#include "boost-test.hpp"
-
-namespace ndn {
-namespace security {
-namespace v1 {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V1)
-BOOST_AUTO_TEST_SUITE(TestPublicKey)
-
-const std::string RSA_DER("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuFoDcNtffwbfFix64fw0\
-hI2tKMkFrc6Ex7yw0YLMK9vGE8lXOyBl/qXabow6RCz+GldmFN6E2Qhm1+AX3Zm5\
-sj3H53/HPtzMefvMQ9X7U+lK8eNMWawpRzvBh4/36VrK/awlkNIVIQ9aXj6q6BVe\
-zL+zWT/WYemLq/8A1/hHWiwCtfOH1xQhGqWHJzeSgwIgOOrzxTbRaCjhAb1u2TeV\
-yx/I9H/DV+AqSHCaYbB92HDcDN0kqwSnUf5H1+osE9MR5DLBLhXdSiULSgxT3Or/\
-y2QgsgUK59WrjhlVMPEiHHRs15NZJbL1uQFXjgScdEarohcY3dilqotineFZCeN8\
-DwIDAQAB");
-
-const uint8_t RSA_DER_KEY_DIGEST[] = {
-  0x1d, 0x20,
-    0x58, 0x72, 0x4c, 0xf7, 0x36, 0x3d, 0xee, 0x4a,
-    0x5c, 0x5b, 0x39, 0x44, 0x2d, 0xf6, 0x1a, 0x24,
-    0xda, 0x13, 0xac, 0xab, 0x70, 0xf7, 0x74, 0x40,
-    0x5a, 0x44, 0xfe, 0xc0, 0xc9, 0x26, 0x58, 0x74
-};
-
-const std::string ECDSA_DER("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENZpqkPJDj8uhSpffOiCbvSYMLsGB\
-1Eo/WU6mrexjGvduQXjqwon/eSHFI6EgHZk8L9KfiV5XVtVsk2g5wIpJVg==");
-
-const uint8_t ECDSA_DER_KEY_DIGEST[] = {
-  0x1d, 0x20,
-    0xaf, 0x82, 0x3f, 0xfc, 0xdc, 0x85, 0xb2, 0xa4,
-    0xc8, 0xf5, 0x3b, 0x1a, 0xf8, 0xec, 0x4a, 0x55,
-    0x97, 0x55, 0x19, 0x3f, 0x54, 0xdd, 0xd0, 0xfd,
-    0xb5, 0x9d, 0x80, 0x65, 0x80, 0x6b, 0x4b, 0x63
-};
-
-BOOST_AUTO_TEST_CASE(Rsa)
-{
-  using namespace CryptoPP;
-
-  OBufferStream os;
-  StringSource ss(reinterpret_cast<const uint8_t*>(RSA_DER.c_str()), RSA_DER.size(),
-                  true, new Base64Decoder(new FileSink(os)));
-
-  shared_ptr<PublicKey> publicKey;
-  BOOST_REQUIRE_NO_THROW(publicKey = shared_ptr<PublicKey>(new PublicKey(os.buf()->buf(),
-                                                                         os.buf()->size())));
-
-  BOOST_CHECK_EQUAL(publicKey->getKeyType(), KeyType::RSA);
-
-  Block digestBlock(RSA_DER_KEY_DIGEST, sizeof(RSA_DER_KEY_DIGEST));
-  const Block& digest = publicKey->computeDigest();
-  BOOST_CHECK_EQUAL_COLLECTIONS(digestBlock.wire(),
-                                digestBlock.wire() + digestBlock.size(),
-                                digest.wire(),
-                                digest.wire() + digest.size());
-}
-
-BOOST_AUTO_TEST_CASE(Ec)
-{
-  using namespace CryptoPP;
-
-  OBufferStream os;
-  StringSource ss(reinterpret_cast<const uint8_t*>(ECDSA_DER.c_str()), ECDSA_DER.size(),
-                  true, new Base64Decoder(new FileSink(os)));
-
-  shared_ptr<PublicKey> publicKey;
-  BOOST_REQUIRE_NO_THROW(publicKey = shared_ptr<PublicKey>(new PublicKey(os.buf()->buf(),
-                                                                         os.buf()->size())));
-
-  BOOST_CHECK_EQUAL(publicKey->getKeyType(), KeyType::EC);
-
-  Block digestBlock(ECDSA_DER_KEY_DIGEST, sizeof(ECDSA_DER_KEY_DIGEST));
-  const Block& digest = publicKey->computeDigest();
-  BOOST_CHECK_EQUAL_COLLECTIONS(digestBlock.wire(),
-                                digestBlock.wire() + digestBlock.size(),
-                                digest.wire(),
-                                digest.wire() + digest.size());
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestPublicKey
-BOOST_AUTO_TEST_SUITE_END() // V1
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace v1
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/v1/sec-public-info-sqlite3.t.cpp b/tests/unit-tests/security/v1/sec-public-info-sqlite3.t.cpp
deleted file mode 100644
index aaa0499..0000000
--- a/tests/unit-tests/security/v1/sec-public-info-sqlite3.t.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/v1/sec-public-info-sqlite3.hpp"
-#include "security/v1/key-chain.hpp"
-#include "security/v1/cryptopp.hpp"
-#include "encoding/buffer-stream.hpp"
-#include "util/time.hpp"
-
-#include "boost-test.hpp"
-
-#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
-
-namespace ndn {
-namespace security {
-namespace v1 {
-namespace tests {
-
-class PibTmpPathFixture
-{
-public:
-  PibTmpPathFixture()
-  {
-    boost::system::error_code error;
-    tmpPath = boost::filesystem::temp_directory_path(error);
-    BOOST_REQUIRE(boost::system::errc::success == error.value());
-    tmpPath /= boost::lexical_cast<std::string>(random::generateWord32());
-  }
-
-  ~PibTmpPathFixture()
-  {
-    boost::filesystem::remove_all(tmpPath);
-  }
-
-public:
-  boost::filesystem::path tmpPath;
-};
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V1)
-BOOST_AUTO_TEST_SUITE(TestSecPublicInfoSqlite3)
-
-const std::string RSA_DER("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuFoDcNtffwbfFix64fw0\
-hI2tKMkFrc6Ex7yw0YLMK9vGE8lXOyBl/qXabow6RCz+GldmFN6E2Qhm1+AX3Zm5\
-sj3H53/HPtzMefvMQ9X7U+lK8eNMWawpRzvBh4/36VrK/awlkNIVIQ9aXj6q6BVe\
-zL+zWT/WYemLq/8A1/hHWiwCtfOH1xQhGqWHJzeSgwIgOOrzxTbRaCjhAb1u2TeV\
-yx/I9H/DV+AqSHCaYbB92HDcDN0kqwSnUf5H1+osE9MR5DLBLhXdSiULSgxT3Or/\
-y2QgsgUK59WrjhlVMPEiHHRs15NZJbL1uQFXjgScdEarohcY3dilqotineFZCeN8\
-DwIDAQAB");
-const std::string ECDSA_DER("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENZpqkPJDj8uhSpffOiCbvSYMLsGB\
-1Eo/WU6mrexjGvduQXjqwon/eSHFI6EgHZk8L9KfiV5XVtVsk2g5wIpJVg==");
-
-BOOST_FIXTURE_TEST_CASE(Basic, PibTmpPathFixture)
-{
-  SecPublicInfoSqlite3 pib(tmpPath.generic_string());
-
-  BOOST_CHECK(pib.doesTableExist("Identity"));
-  BOOST_CHECK(pib.doesTableExist("Key"));
-  BOOST_CHECK(pib.doesTableExist("Certificate"));
-}
-
-BOOST_FIXTURE_TEST_CASE(TpmLocatorTest, PibTmpPathFixture)
-{
-  SecPublicInfoSqlite3 pib(tmpPath.generic_string());
-
-  BOOST_REQUIRE_THROW(pib.getTpmLocator(), SecPublicInfo::Error);
-  pib.addIdentity("/test/id1");
-  BOOST_CHECK(pib.doesIdentityExist("/test/id1"));
-
-  // Pib does not have tpmInfo set yet, setTpmInfo simply set the tpmInfo.
-  std::string tpmLocator("tpm-file:");
-  tpmLocator.append((tmpPath / "tpm").generic_string());
-  pib.setTpmLocator(tpmLocator);
-  BOOST_CHECK(pib.doesIdentityExist("/test/id1"));
-
-  BOOST_REQUIRE_NO_THROW(pib.getTpmLocator());
-  BOOST_CHECK_EQUAL(tpmLocator, pib.getTpmLocator());
-
-  // Pib has tpmInfo set, set a different tpmInfo will reset Pib content.
-  std::string tpmLocator3("tpm-osxkeychain:");
-  pib.setTpmLocator(tpmLocator3);
-  BOOST_CHECK(!pib.doesIdentityExist("/test/id1"));
-}
-
-BOOST_AUTO_TEST_CASE(KeyTypeRsa)
-{
-  using namespace CryptoPP;
-
-  OBufferStream os;
-  StringSource ss(reinterpret_cast<const uint8_t*>(RSA_DER.c_str()), RSA_DER.size(),
-                  true, new Base64Decoder(new FileSink(os)));
-
-  shared_ptr<v1::PublicKey> rsaKey;
-  BOOST_REQUIRE_NO_THROW(rsaKey = make_shared<v1::PublicKey>(os.buf()->buf(), os.buf()->size()));
-  Name rsaKeyName("/TestSecPublicInfoSqlite3/KeyType/RSA/ksk-123");
-  SecPublicInfoSqlite3 pib;
-  pib.addKey(rsaKeyName, *rsaKey);
-
-  BOOST_CHECK_EQUAL(KeyType::RSA, pib.getPublicKeyType(rsaKeyName));
-
-  pib.deleteIdentityInfo(Name("/TestSecPublicInfoSqlite3/KeyType/RSA"));
-}
-
-BOOST_AUTO_TEST_CASE(KeyTypeEc)
-{
-  using namespace CryptoPP;
-
-  OBufferStream os;
-  StringSource ss(reinterpret_cast<const uint8_t*>(ECDSA_DER.c_str()), ECDSA_DER.size(),
-                  true, new Base64Decoder(new FileSink(os)));
-
-  shared_ptr<v1::PublicKey> ecKey;
-  BOOST_REQUIRE_NO_THROW(ecKey = make_shared<v1::PublicKey>(os.buf()->buf(), os.buf()->size()));
-  Name ecKeyName("/TestSecPublicInfoSqlite3/KeyType/EC/ksk-123");
-  SecPublicInfoSqlite3 pib;
-  pib.addKey(ecKeyName, *ecKey);
-
-  BOOST_CHECK_EQUAL(KeyType::EC, pib.getPublicKeyType(ecKeyName));
-  pib.deleteIdentityInfo(Name("/TestSecPublicInfoSqlite3/KeyType/EC"));
-}
-
-BOOST_AUTO_TEST_CASE(KeyTypeNonExistent)
-{
-  Name nullKeyName("/TestSecPublicInfoSqlite3/KeyType/Null");
-  SecPublicInfoSqlite3 pib;
-
-  BOOST_CHECK_EQUAL(KeyType::NONE, pib.getPublicKeyType(nullKeyName));
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestSecPublicInfoSqlite3
-BOOST_AUTO_TEST_SUITE_END() // V1
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace v1
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/v1/sec-tpm-file.t.cpp b/tests/unit-tests/security/v1/sec-tpm-file.t.cpp
deleted file mode 100644
index 54518d8..0000000
--- a/tests/unit-tests/security/v1/sec-tpm-file.t.cpp
+++ /dev/null
@@ -1,417 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/v1/sec-tpm-file.hpp"
-#include "security/v1/key-chain.hpp"
-#include "security/v1/cryptopp.hpp"
-#include "util/time.hpp"
-
-#include "boost-test.hpp"
-
-#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
-
-namespace ndn {
-namespace security {
-namespace v1 {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V1)
-BOOST_AUTO_TEST_SUITE(TestSecTpmFile)
-
-BOOST_AUTO_TEST_CASE(Delete)
-{
-  SecTpmFile tpm;
-
-  Name keyName("/TestSecTpmFile/Delete/ksk-" +
-               boost::lexical_cast<std::string>(time::toUnixTimestamp(time::system_clock::now())));
-  RsaKeyParams params(2048);
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-}
-
-BOOST_AUTO_TEST_CASE(SignVerify)
-{
-  SecTpmFile tpm;
-
-  Name keyName("/TestSecTpmFile/SignVerify/ksk-" +
-               boost::lexical_cast<std::string>(time::toUnixTimestamp(time::system_clock::now())));
-  RsaKeyParams params(2048);
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  Data data("/tmp/test/1");
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-  shared_ptr<v1::PublicKey> publicKey;
-  BOOST_CHECK_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      RSA::PublicKey rsaPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      rsaPublicKey.Load(queue);
-
-      RSASS<PKCS1v15, SHA256>::Verifier verifier(rsaPublicKey);
-      bool result = verifier.VerifyMessage(content, sizeof(content),
-                                           sigBlock.value(), sigBlock.value_size());
-
-      BOOST_CHECK_EQUAL(result, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-}
-
-BOOST_AUTO_TEST_CASE(RandomGenerator)
-{
-  SecTpmFile tpm;
-
-  constexpr size_t scale = 1000;
-  constexpr size_t size = 256 * scale;
-  auto block = unique_ptr<uint8_t[]>{new uint8_t[size]};
-  tpm.generateRandomBlock(block.get(), size);
-
-  std::map<uint8_t, size_t> counter;
-  for (size_t i = 0; i < size; i++) {
-    counter[block[i]] += 1;
-  }
-
-  double dev = 0.0;
-  for (uint8_t i = 0; i < 255; i++) {
-    dev += static_cast<double>((counter[i] - scale) * (counter[i] - scale)) / (scale * scale);
-  }
-  dev /= 256;
-
-  BOOST_CHECK_CLOSE(dev, 0.001, 100);
-}
-
-BOOST_AUTO_TEST_CASE(ImportExportKey)
-{
-  using namespace CryptoPP;
-
-  std::string imported =
-"MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIIJzwsbTIVqgCAggAMBQGCCqG"
-"SIb3DQMHBAiEsSKdgGkCEQSCBMjaYsEeHM/EPzGNDAPaSxE1ASKxjyNkXEVPQbtGx/ju1PlQ"
-"QakTCzPpia8ziVGihrVfuacHrxxbLh+ufNZtbVVsv9kGQL2g15BN2Nic8VqyTxplKrduFkEb"
-"eOipqu627gb6eTsrSj7kubXfs/w9OAdhRZFaEc7I/S6rcPUaDai4i3O03VuvuTOrzZL/unhD"
-"CDzOa3pr2aUQlO/5Pck6GbSYL1/4aW/fB7djZrZAjsGPTqIYpPa16oWlrzsILQ4650Zlvdn8"
-"feh6elTrA4qy6RljZfhIHxzGAeuGbVVLT7zavs01y+QE88sxPpeZ0RGtlVxCYp+xoB5hOO/x"
-"Xm3n0r+HVIaBV9rHLuUSUiHVAtzwuOj/XKh7YBNXeF58lcv8Npsx10etrPuV5hRQelYirKo1"
-"QbT+Aq7sLdWI09eGClDHjvRgw54lCFEUAVUFLxhBnzfVUfw/UiR2SheixH+c7cY3gOOvSMQh"
-"1oL9Omii4S6yhzfbD3hRN/wBKC0NgiIOLRR+Ti0mEEbTxYQrVcHC9rpRcnr1fFAiQvOXrOw0"
-"HyxsbnOeYpoURgLJmUyItPi09xUMCHwUPZ/sI6aG5eRqVUGgcYaQib7MBbGG/D2PlWaKZx1w"
-"iEYtYUI7rrc7Qc2ltp4i1u46ZLtSOxUi8kM7qK2Yp1AOtcWFlGn0XBXpGsHanZRzs8KzfDjQ"
-"OPmRIuFXFmuJweqUGmg6c8P3wHYueenB4oowYELYaDwmmV96obXMG5hbsKne5kcem875d6K+"
-"hL2QzjAl+na4tUZyXYXDdUO2lgTT8IItujBn6c+b8vDcZ24NcYyWPHHb16J4uvKi/6Zb245g"
-"/N0NC6hB43KE+2F0BH0eyXRzCnen6AjF8nvx/wgYrXsFlsU47P8gaL1e7V6QECkY4vIk6//b"
-"LINmpcgZoAv23fgjvYYTMfS/IyPsooS5DJarbHzbsgAWOuqP2ewYulrKqLi0vaUyoErRedQC"
-"8J5p9c4KF56++ameiwxbyKnDynHIIFCOM8eamLnDH4VvU9E2mtfZxmi8kWDWx/NhKEK9zbQv"
-"WuaGDpOysgPK4myTp2QGQNQDvBB92gMcrVTcY//3OGHSXeJrkUfDKLOUDyz7ROghEt1vpRTL"
-"j9Xdbm/01O/0MLBqyXDY119b1qAVVY7Y2CxRIRFdw2V76INWNIwPi46t/VUGwMBGmEux8S8+"
-"79Mv7UyGhKvSUr88pWCS1KdSz1HhN1VWjDvyXPyg96+SecpZMwXCdkUCLdLdD3/8rJLt7wS5"
-"3K5/1V4sacds8GHx7NckhQ/KV0VDlUEFuaOCS4Sd3XXetXs4IFSqtKH+Rn0jX7d8Igcw7X2b"
-"eaV1gxOVquDEwLDT5+wXURw96ahq0caL/4YfoBUQIOQ6HGtPTWJz1Yax0pGu9F30VEY/ObrK"
-"L/B6peJKfqhQGJ+MObqOiP6yHBZH75EImLAkksSVmREdNVjwWkz9D9vzPoAnmP8sQ3/NZarB"
-"Ak+ynQjc19t+CCecPrS2Tlh0cJZkHRiGFF7J5a3ci7yBvg3HfD86AXMRBQuSG1UG8TrzC6BK"
-"+qIQ8DWecQwBMZ3nv/Flo2Fejd/G4/wWe6ObMytC5SB8pJNOq9ri0Ff6Zh3rPrwaSv1PPgFJ"
-"GOw=";
-
-  std::string decoded;
-  BOOST_CHECK_NO_THROW(StringSource source(imported,
-                                           true,
-                                           new Base64Decoder(new StringSink(decoded))));
-
-  SecTpmFile tpm;
-
-  Name keyName("/TestSecTpmFile/ImportKey/ksk-" +
-               boost::lexical_cast<std::string>(time::toUnixTimestamp(time::system_clock::now())));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-
-  BOOST_REQUIRE_NO_THROW(
-    tpm.importPrivateKeyPkcs5IntoTpm(keyName,
-                                     reinterpret_cast<const uint8_t*>(decoded.c_str()),
-                                     decoded.size(),
-                                     "1234"));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-
-  shared_ptr<v1::PublicKey> publicKey;
-  BOOST_CHECK_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
-
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      RSA::PublicKey rsaPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      rsaPublicKey.Load(queue);
-
-      RSASS<PKCS1v15, SHA256>::Verifier verifier(rsaPublicKey);
-      bool isVerified = verifier.VerifyMessage(content, sizeof(content),
-                                               sigBlock.value(), sigBlock.value_size());
-
-      BOOST_CHECK_EQUAL(isVerified, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  ConstBufferPtr exported;
-  BOOST_CHECK_NO_THROW(exported = tpm.exportPrivateKeyPkcs5FromTpm(keyName, "5678"));
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-
-  BOOST_REQUIRE(tpm.importPrivateKeyPkcs5IntoTpm(keyName, exported->buf(), exported->size(),
-                                                 "5678"));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-
-  const uint8_t content2[] = {0x05, 0x06, 0x07, 0x08};
-  Block sigBlock2;
-  BOOST_CHECK_NO_THROW(sigBlock2 = tpm.signInTpm(content2, sizeof(content2),
-                                                 keyName, DigestAlgorithm::SHA256));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      RSA::PublicKey rsaPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      rsaPublicKey.Load(queue);
-
-      RSASS<PKCS1v15, SHA256>::Verifier verifier(rsaPublicKey);
-      bool isVerified = verifier.VerifyMessage(content2, sizeof(content2),
-                                               sigBlock2.value(), sigBlock2.value_size());
-
-      BOOST_CHECK_EQUAL(isVerified, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-}
-
-BOOST_AUTO_TEST_CASE(EcdsaSigning)
-{
-  SecTpmFile tpm;
-
-  Name keyName("/TestSecTpmFile/EcdsaSigning/ksk-" +
-               boost::lexical_cast<std::string>(time::toUnixTimestamp(time::system_clock::now())));
-  EcKeyParams params;
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  Data data("/TestSecTpmFile/EcdsaSigning/Data/1");
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-
-  shared_ptr<v1::PublicKey> pubkeyPtr;
-  BOOST_CHECK_NO_THROW(pubkeyPtr = tpm.getPublicKeyFromTpm(keyName));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      ECDSA<ECP, SHA256>::PublicKey publicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(pubkeyPtr->get().buf()), pubkeyPtr->get().size());
-      publicKey.Load(queue);
-
-      uint8_t buffer[64];
-      size_t usedSize = DSAConvertSignatureFormat(buffer, 64, DSA_P1363,
-                                                  sigBlock.value(), sigBlock.value_size(), DSA_DER);
-
-      ECDSA<ECP, SHA256>::Verifier verifier(publicKey);
-      bool result = verifier.VerifyMessage(content, sizeof(content),
-                                           buffer, usedSize);
-
-      BOOST_CHECK_EQUAL(result, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-}
-
-
-BOOST_AUTO_TEST_CASE(ImportExportEcKey)
-{
-  using namespace CryptoPP;
-
-  std::string imported =
-    "MIGMMEAGCSqGSIb3DQEFDTAzMBsGCSqGSIb3DQEFDDAOBAhqkJiLfzFWtQICCAAw"
-    "FAYIKoZIhvcNAwcECJ1HLtP8OZC6BEgNv9OH2mZdbkxvqTVlRBkUqPbbP3580OG6"
-    "f0htqWSRppcb4IEKYfuPt2qPCYKL2GcAN2pU3eJqhiM7LFTSFaxgBRFozzIwusk=";
-
-  std::string decoded;
-  BOOST_CHECK_NO_THROW(StringSource source(imported,
-                                           true,
-                                           new Base64Decoder(new StringSink(decoded))));
-
-  SecTpmFile tpm;
-
-  Name keyName("/TestSecTpmFile/ImportExportEcKey/ksk-" +
-               boost::lexical_cast<std::string>(time::toUnixTimestamp(time::system_clock::now())));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-
-  BOOST_REQUIRE_NO_THROW(
-    tpm.importPrivateKeyPkcs5IntoTpm(keyName,
-                                     reinterpret_cast<const uint8_t*>(decoded.c_str()),
-                                     decoded.size(),
-                                     "5678"));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-
-  shared_ptr<v1::PublicKey> publicKey;
-  BOOST_CHECK_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
-
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      ECDSA<ECP, SHA256>::PublicKey ecPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      ecPublicKey.Load(queue);
-
-      uint8_t buffer[64];
-      size_t usedSize = DSAConvertSignatureFormat(buffer, 64, DSA_P1363,
-                                                  sigBlock.value(), sigBlock.value_size(), DSA_DER);
-
-      ECDSA<ECP, SHA256>::Verifier verifier(ecPublicKey);
-      bool isVerified = verifier.VerifyMessage(content, sizeof(content),
-                                               buffer, usedSize);
-
-      BOOST_CHECK_EQUAL(isVerified, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  ConstBufferPtr exported;
-  BOOST_CHECK_NO_THROW(exported = tpm.exportPrivateKeyPkcs5FromTpm(keyName, "1234"));
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-
-  BOOST_REQUIRE(tpm.importPrivateKeyPkcs5IntoTpm(keyName, exported->buf(), exported->size(),
-                                                 "1234"));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-
-  const uint8_t content2[] = {0x05, 0x06, 0x07, 0x08};
-  Block sigBlock2;
-  BOOST_CHECK_NO_THROW(sigBlock2 = tpm.signInTpm(content2, sizeof(content2),
-                                                 keyName, DigestAlgorithm::SHA256));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      ECDSA<ECP, SHA256>::PublicKey ecPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      ecPublicKey.Load(queue);
-
-      uint8_t buffer[64];
-      size_t usedSize = DSAConvertSignatureFormat(buffer, 64, DSA_P1363,
-                                                  sigBlock2.value(), sigBlock2.value_size(),
-                                                  DSA_DER);
-
-      ECDSA<ECP, SHA256>::Verifier verifier(ecPublicKey);
-      bool isVerified = verifier.VerifyMessage(content2, sizeof(content2),
-                                               buffer, usedSize);
-
-      BOOST_CHECK_EQUAL(isVerified, true);
-
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestSecTpmFile
-BOOST_AUTO_TEST_SUITE_END() // V1
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace v1
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/v1/sec-tpm-osx.t.cpp b/tests/unit-tests/security/v1/sec-tpm-osx.t.cpp
deleted file mode 100644
index 7c36328..0000000
--- a/tests/unit-tests/security/v1/sec-tpm-osx.t.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/v1/sec-tpm-osx.hpp"
-#include "security/v1/cryptopp.hpp"
-#include "util/time.hpp"
-
-#include "boost-test.hpp"
-
-#include <boost/lexical_cast.hpp>
-#include <Availability.h>
-
-namespace ndn {
-namespace security {
-namespace v1 {
-namespace tests {
-
-class OsxKeyChainTestFixture
-{
-public:
-  OsxKeyChainTestFixture()
-  {
-    std::string oldHOME;
-    if (std::getenv("OLD_HOME"))
-      oldHOME = std::getenv("OLD_HOME");
-
-    if (std::getenv("HOME"))
-      m_HOME = std::getenv("HOME");
-
-    if (!oldHOME.empty())
-      setenv("HOME", oldHOME.c_str(), 1);
-    else
-      unsetenv("HOME");
-  }
-
-  ~OsxKeyChainTestFixture()
-  {
-    if (!m_HOME.empty())
-      setenv("HOME", m_HOME.c_str(), 1);
-    else
-      unsetenv("HOME");
-  }
-
-protected:
-  std::string m_HOME;
-};
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V1)
-BOOST_FIXTURE_TEST_SUITE(TestSecTpmOsx, OsxKeyChainTestFixture)
-
-BOOST_AUTO_TEST_CASE(Delete)
-{
-  SecTpmOsx tpm;
-
-  Name keyName("/TestSecTpmOsx/Delete/ksk-" +
-               boost::lexical_cast<std::string>(
-                 time::toUnixTimestamp(time::system_clock::now()).count()));
-  RsaKeyParams params(2048);
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-}
-
-BOOST_AUTO_TEST_CASE(SignVerify)
-{
-  SecTpmOsx tpm;
-
-  Name keyName("/TestSecTpmOsx/SignVerify/ksk-" +
-               boost::lexical_cast<std::string>(
-                 time::toUnixTimestamp(time::system_clock::now()).count()));
-  RsaKeyParams params(2048);
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  Data data("/TestSecTpmOsx/SignVaerify/Data/1");
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-
-  shared_ptr<v1::PublicKey> publicKey;
-  BOOST_CHECK_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
-  try
-    {
-      using namespace CryptoPP;
-
-      RSA::PublicKey rsaPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      rsaPublicKey.Load(queue);
-
-      RSASS<PKCS1v15, SHA256>::Verifier verifier(rsaPublicKey);
-      bool isVerified = verifier.VerifyMessage(content, sizeof(content),
-                                               sigBlock.value(), sigBlock.value_size());
-
-      BOOST_CHECK_EQUAL(isVerified, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-}
-
-BOOST_AUTO_TEST_CASE(RandomGenerator)
-{
-  SecTpmOsx tpm;
-
-  size_t scale = 1000;
-  size_t size = 256 * scale;
-  uint8_t* block = new uint8_t[size];
-  tpm.generateRandomBlock(block, size);
-
-  std::map<uint8_t, int> counter;
-  for (size_t i = 0; i < size; i++)
-    {
-      counter[block[i]] += 1;
-    }
-
-  float dev = 0.0;
-  for (size_t i = 0; i != 255; i++)
-    {
-      dev += ((counter[i] - scale) * (counter[i] - scale)) * 1.0 / (scale * scale);
-    }
-
-  BOOST_CHECK_CLOSE(dev / 256, 0.001, 100);
-
-}
-
-BOOST_AUTO_TEST_CASE(ExportImportKey)
-{
-  using namespace CryptoPP;
-
-  SecTpmOsx tpm;
-
-  Name keyName("/TestSecTpmOsx/ExportImportKey/ksk-" +
-               boost::lexical_cast<std::string>(
-                 time::toUnixTimestamp(time::system_clock::now()).count()));
-
-  RsaKeyParams params(2048);
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-
-  ConstBufferPtr exported;
-  BOOST_CHECK_NO_THROW(exported = tpm.exportPrivateKeyPkcs5FromTpm(keyName, "1234"));
-  shared_ptr<v1::PublicKey> publicKey;
-  BOOST_REQUIRE_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-
-  BOOST_REQUIRE(tpm.importPrivateKeyPkcs5IntoTpm(keyName,
-                                                 exported->buf(), exported->size(),
-                                                 "1234"));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      RSA::PublicKey rsaPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      rsaPublicKey.Load(queue);
-
-      RSASS<PKCS1v15, SHA256>::Verifier verifier(rsaPublicKey);
-      bool isVerified = verifier.VerifyMessage(content, sizeof(content),
-                                               sigBlock.value(), sigBlock.value_size());
-
-      BOOST_CHECK_EQUAL(isVerified, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-  // This is some problem related to Mac OS Key chain.
-  // On OSX 10.8, we cannot delete imported keys, but there is no such problem on OSX 10.9.
-#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
-#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_9
-  BOOST_REQUIRE(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE) == false);
-  BOOST_REQUIRE(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC) == false);
-#endif
-#endif
-}
-
-BOOST_AUTO_TEST_CASE(NonExistingKey)
-{
-  using namespace CryptoPP;
-
-  SecTpmOsx tpm;
-
-  Name keyName("/TestSecTpmOsx/NonExistingKey");
-
-  BOOST_REQUIRE_THROW(tpm.getPublicKeyFromTpm(keyName), SecTpmOsx::Error);
-
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-  BOOST_REQUIRE_THROW(tpm.signInTpm(content, sizeof(content), keyName, DigestAlgorithm::SHA256),
-                      SecTpmOsx::Error);
-
-  BOOST_REQUIRE_THROW(tpm.signInTpm(0, 1, keyName, DigestAlgorithm::SHA256),
-                      SecTpmOsx::Error);
-}
-
-BOOST_AUTO_TEST_CASE(EcdsaSigning)
-{
-  SecTpmOsx tpm;
-
-  Name keyName("/TestSecTpmOsx/EcdsaSigning/ksk-" +
-               boost::lexical_cast<std::string>(time::toUnixTimestamp(time::system_clock::now())));
-  EcKeyParams params;
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  Data data("/TestSecTpmOsx/EcdsaSigning/Data/1");
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-
-  shared_ptr<v1::PublicKey> pubkeyPtr;
-  BOOST_CHECK_NO_THROW(pubkeyPtr = tpm.getPublicKeyFromTpm(keyName));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      ECDSA<ECP, SHA256>::PublicKey publicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(pubkeyPtr->get().buf()), pubkeyPtr->get().size());
-      publicKey.Load(queue);
-
-      uint8_t buffer[64];
-      size_t usedSize = DSAConvertSignatureFormat(buffer, 64, DSA_P1363,
-                                                  sigBlock.value(), sigBlock.value_size(), DSA_DER);
-
-      ECDSA<ECP, SHA256>::Verifier verifier(publicKey);
-      bool result = verifier.VerifyMessage(content, sizeof(content),
-                                           buffer, usedSize);
-
-      BOOST_CHECK_EQUAL(result, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-}
-
-
-BOOST_AUTO_TEST_CASE(ExportImportEcKey)
-{
-  using namespace CryptoPP;
-
-  SecTpmOsx tpm;
-
-  Name keyName("/TestSecTpmOsx/ExportImportEcKey/ksk-" +
-               boost::lexical_cast<std::string>(
-                 time::toUnixTimestamp(time::system_clock::now()).count()));
-
-  EcKeyParams params;
-  BOOST_CHECK_NO_THROW(tpm.generateKeyPairInTpm(keyName, params));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-
-  ConstBufferPtr exported;
-  BOOST_CHECK_NO_THROW(exported = tpm.exportPrivateKeyPkcs5FromTpm(keyName, "1234"));
-
-  shared_ptr<v1::PublicKey> publicKey;
-  BOOST_REQUIRE_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
-
-  tpm.deleteKeyPairInTpm(keyName);
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), false);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), false);
-
-  BOOST_REQUIRE(tpm.importPrivateKeyPkcs5IntoTpm(keyName,
-                                                 exported->buf(), exported->size(),
-                                                 "1234"));
-
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
-  BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
-
-  const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
-  Block sigBlock;
-  BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
-                                                keyName, DigestAlgorithm::SHA256));
-
-  try
-    {
-      using namespace CryptoPP;
-
-      ECDSA<ECP, SHA256>::PublicKey ecPublicKey;
-      ByteQueue queue;
-      queue.Put(reinterpret_cast<const byte*>(publicKey->get().buf()), publicKey->get().size());
-      ecPublicKey.Load(queue);
-
-      uint8_t buffer[64];
-      size_t usedSize = DSAConvertSignatureFormat(buffer, 64, DSA_P1363,
-                                                  sigBlock.value(), sigBlock.value_size(),
-                                                  DSA_DER);
-
-      ECDSA<ECP, SHA256>::Verifier verifier(ecPublicKey);
-      bool isVerified = verifier.VerifyMessage(content, sizeof(content),
-                                               buffer, usedSize);
-
-      BOOST_CHECK_EQUAL(isVerified, true);
-    }
-  catch (CryptoPP::Exception& e)
-    {
-      BOOST_CHECK(false);
-    }
-
-  tpm.deleteKeyPairInTpm(keyName);
-  // This is some problem related to Mac OS Key chain.
-  // On OSX 10.8, we cannot delete imported keys, but there is no such problem on OSX 10.9.
-#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
-#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_9
-  BOOST_REQUIRE(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE) == false);
-  BOOST_REQUIRE(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC) == false);
-#endif
-#endif
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestSecTpmOsx
-BOOST_AUTO_TEST_SUITE_END() // V1
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace v1
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/validator.t.cpp b/tests/unit-tests/security/validator.t.cpp
deleted file mode 100644
index 7550eb3..0000000
--- a/tests/unit-tests/security/validator.t.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/validator.hpp"
-
-#include "boost-test.hpp"
-#include "identity-management-fixture.hpp"
-#include "make-interest-data.hpp"
-
-namespace ndn {
-namespace security {
-namespace tests {
-
-using namespace ndn::tests;
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestValidator, IdentityManagementV1Fixture)
-
-const uint8_t ecdsaSigInfo[] = {
-0x16, 0x1b, // SignatureInfo
-  0x1b, 0x01, // SignatureType
-    0x03,
-  0x1c, 0x16, // KeyLocator
-    0x07, 0x14, // Name
-      0x08, 0x04,
-        0x74, 0x65, 0x73, 0x74,
-      0x08, 0x03,
-        0x6b, 0x65, 0x79,
-      0x08, 0x07,
-        0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
-};
-
-const uint8_t ecdsaSigValue[] = {
-0x17, 0x40, // SignatureValue
-  0x2f, 0xd6, 0xf1, 0x6e, 0x80, 0x6f, 0x10, 0xbe, 0xb1, 0x6f, 0x3e, 0x31, 0xec,
-  0xe3, 0xb9, 0xea, 0x83, 0x30, 0x40, 0x03, 0xfc, 0xa0, 0x13, 0xd9, 0xb3, 0xc6,
-  0x25, 0x16, 0x2d, 0xa6, 0x58, 0x41, 0x69, 0x62, 0x56, 0xd8, 0xb3, 0x6a, 0x38,
-  0x76, 0x56, 0xea, 0x61, 0xb2, 0x32, 0x70, 0x1c, 0xb6, 0x4d, 0x10, 0x1d, 0xdc,
-  0x92, 0x8e, 0x52, 0xa5, 0x8a, 0x1d, 0xd9, 0x96, 0x5e, 0xc0, 0x62, 0x0b
-};
-
-BOOST_AUTO_TEST_CASE(RsaSignatureVerification)
-{
-  Name identity("/TestValidator/RsaSignatureVerification");
-  addIdentity(identity, RsaKeyParams());
-  Name keyName = m_keyChain.getDefaultKeyNameForIdentity(identity);
-  shared_ptr<v1::PublicKey> publicKey = m_keyChain.getPublicKey(keyName);
-
-  Name identity2("/TestValidator/RsaSignatureVerification/id2");
-  addIdentity(identity2, RsaKeyParams());
-  Name keyName2 = m_keyChain.getDefaultKeyNameForIdentity(identity2);
-  shared_ptr<v1::PublicKey> publicKey2 = m_keyChain.getPublicKey(keyName2);
-
-  Data data("/TestData/1");
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(data,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
-  BOOST_CHECK_EQUAL(Validator::verifySignature(data, *publicKey), true);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(data, *publicKey2), false);
-
-  Interest interest("/TestInterest/1");
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(interest,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
-  BOOST_CHECK_EQUAL(Validator::verifySignature(interest, *publicKey), true);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(interest, *publicKey2), false);
-
-  Data wrongData("/TestData/2");
-  Block ecdsaSigInfoBlock(ecdsaSigInfo, sizeof(ecdsaSigInfo));
-  Block ecdsaSigValueBlock(ecdsaSigValue, sizeof(ecdsaSigValue));
-  Signature ecdsaSig(ecdsaSigInfoBlock, ecdsaSigValueBlock);
-  wrongData.setSignature(ecdsaSig);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(wrongData, *publicKey), false);
-}
-
-const uint8_t rsaSigInfo[] = {
-0x16, 0x1b, // SignatureInfo
-  0x1b, 0x01, // SignatureType
-    0x01,
-  0x1c, 0x16, // KeyLocator
-    0x07, 0x14, // Name
-      0x08, 0x04,
-        0x74, 0x65, 0x73, 0x74,
-      0x08, 0x03,
-        0x6b, 0x65, 0x79,
-      0x08, 0x07,
-        0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
-};
-
-const uint8_t rsaSigValue[] = {
-0x17, 0x80, // SignatureValue
-  0x2f, 0xd6, 0xf1, 0x6e, 0x80, 0x6f, 0x10, 0xbe, 0xb1, 0x6f, 0x3e, 0x31, 0xec,
-  0xe3, 0xb9, 0xea, 0x83, 0x30, 0x40, 0x03, 0xfc, 0xa0, 0x13, 0xd9, 0xb3, 0xc6,
-  0x25, 0x16, 0x2d, 0xa6, 0x58, 0x41, 0x69, 0x62, 0x56, 0xd8, 0xb3, 0x6a, 0x38,
-  0x76, 0x56, 0xea, 0x61, 0xb2, 0x32, 0x70, 0x1c, 0xb6, 0x4d, 0x10, 0x1d, 0xdc,
-  0x92, 0x8e, 0x52, 0xa5, 0x8a, 0x1d, 0xd9, 0x96, 0x5e, 0xc0, 0x62, 0x0b, 0xcf,
-  0x3a, 0x9d, 0x7f, 0xca, 0xbe, 0xa1, 0x41, 0x71, 0x85, 0x7a, 0x8b, 0x5d, 0xa9,
-  0x64, 0xd6, 0x66, 0xb4, 0xe9, 0x8d, 0x0c, 0x28, 0x43, 0xee, 0xa6, 0x64, 0xe8,
-  0x55, 0xf6, 0x1c, 0x19, 0x0b, 0xef, 0x99, 0x25, 0x1e, 0xdc, 0x78, 0xb3, 0xa7,
-  0xaa, 0x0d, 0x14, 0x58, 0x30, 0xe5, 0x37, 0x6a, 0x6d, 0xdb, 0x56, 0xac, 0xa3,
-  0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1
-};
-
-
-BOOST_AUTO_TEST_CASE(EcdsaSignatureVerification)
-{
-  Name identity("/TestValidator/EcdsaSignatureVerification");
-  addIdentity(identity, EcKeyParams());
-  Name keyName = m_keyChain.getDefaultKeyNameForIdentity(identity);
-  shared_ptr<v1::PublicKey> publicKey = m_keyChain.getPublicKey(keyName);
-
-  Name identity2("/TestValidator/EcdsaSignatureVerification/id2");
-  addIdentity(identity2, EcKeyParams());
-  Name keyName2 = m_keyChain.getDefaultKeyNameForIdentity(identity2);
-  shared_ptr<v1::PublicKey> publicKey2 = m_keyChain.getPublicKey(keyName2);
-
-
-  Data data("/TestData/1");
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(data,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
-  BOOST_CHECK_EQUAL(Validator::verifySignature(data, *publicKey), true);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(data, *publicKey2), false);
-
-  Interest interest("/TestInterest/1");
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(interest,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
-  BOOST_CHECK_EQUAL(Validator::verifySignature(interest, *publicKey), true);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(interest, *publicKey2), false);
-
-  Data wrongData("/TestData/2");
-  Block rsaSigInfoBlock(rsaSigInfo, sizeof(rsaSigInfo));
-  Block rsaSigValueBlock(rsaSigValue, sizeof(rsaSigValue));
-  Signature rsaSig(rsaSigInfoBlock, rsaSigValueBlock);
-  wrongData.setSignature(rsaSig);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(wrongData, *publicKey), false);
-}
-
-BOOST_AUTO_TEST_CASE(EcdsaSignatureVerification2)
-{
-  Name ecIdentity("/SecurityTestValidator/EcdsaSignatureVerification2/ec");
-  addIdentity(ecIdentity, EcKeyParams());
-  Name ecCertName = m_keyChain.getDefaultCertificateNameForIdentity(ecIdentity);
-  shared_ptr<v1::IdentityCertificate> ecCert = m_keyChain.getCertificate(ecCertName);
-
-  Name rsaIdentity("/SecurityTestValidator/EcdsaSignatureVerification2/rsa");
-  addIdentity(rsaIdentity, RsaKeyParams());
-  Name rsaCertName = m_keyChain.getDefaultCertificateNameForIdentity(rsaIdentity);
-  shared_ptr<v1::IdentityCertificate> rsaCert = m_keyChain.getCertificate(rsaCertName);
-
-  Name packetName("/Test/Packet/Name");
-
-  shared_ptr<Data> testDataRsa = make_shared<Data>(packetName);
-  m_keyChain.sign(*testDataRsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        rsaIdentity));
-  shared_ptr<Data> testDataEcdsa = make_shared<Data>(packetName);
-  m_keyChain.sign(*testDataEcdsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        ecIdentity));
-  shared_ptr<Interest> testInterestRsa = make_shared<Interest>(packetName);
-  m_keyChain.sign(*testInterestRsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        rsaIdentity));
-  shared_ptr<Interest> testInterestEcdsa = make_shared<Interest>(packetName);
-  m_keyChain.sign(*testInterestEcdsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        ecIdentity));
-
-  BOOST_CHECK(Validator::verifySignature(*ecCert, ecCert->getPublicKeyInfo()));
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*ecCert, rsaCert->getPublicKeyInfo()), false);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*rsaCert, ecCert->getPublicKeyInfo()), false);
-  BOOST_CHECK(Validator::verifySignature(*rsaCert, rsaCert->getPublicKeyInfo()));
-
-  BOOST_CHECK(Validator::verifySignature(*testDataEcdsa, ecCert->getPublicKeyInfo()));
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*testDataEcdsa, rsaCert->getPublicKeyInfo()), false);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*testDataRsa, ecCert->getPublicKeyInfo()), false);
-  BOOST_CHECK(Validator::verifySignature(*testDataRsa, rsaCert->getPublicKeyInfo()));
-
-  BOOST_CHECK(Validator::verifySignature(*testInterestEcdsa, ecCert->getPublicKeyInfo()));
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*testInterestEcdsa, rsaCert->getPublicKeyInfo()),
-                    false);
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*testInterestRsa, ecCert->getPublicKeyInfo()),
-                    false);
-  BOOST_CHECK(Validator::verifySignature(*testInterestRsa, rsaCert->getPublicKeyInfo()));
-}
-
-BOOST_AUTO_TEST_CASE(MalformedInterestSigInfo)
-{
-  auto interest = make_shared<Interest>("/prefix");
-  m_keyChain.sign(*interest);
-
-  setNameComponent(*interest, signed_interest::POS_SIG_INFO, "not-SignatureInfo");
-
-  v1::PublicKey pubkey = m_keyChain.getDefaultCertificate()->getPublicKeyInfo();
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*interest, pubkey), false);
-}
-
-BOOST_AUTO_TEST_CASE(MalformedInterestSigValue)
-{
-  auto interest = make_shared<Interest>("/prefix");
-  m_keyChain.sign(*interest);
-
-  setNameComponent(*interest, signed_interest::POS_SIG_VALUE, "bad-signature-bits");
-
-  v1::PublicKey pubkey = m_keyChain.getDefaultCertificate()->getPublicKeyInfo();
-  BOOST_CHECK_EQUAL(Validator::verifySignature(*interest, pubkey), false);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestValidator
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace security
-} // namespace ndn
