diff --git a/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp b/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp
index 7f20981..cef4c22 100644
--- a/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp
+++ b/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp
@@ -20,15 +20,18 @@
  */
 
 #include "security/signature-sha256-with-ecdsa.hpp"
-#include "security/validator.hpp"
 #include "util/scheduler.hpp"
 
 #include "boost-test.hpp"
 #include "../identity-management-time-fixture.hpp"
+#include "v2/validator.hpp"
 
 namespace ndn {
+namespace security {
 namespace tests {
 
+using namespace ndn::tests;
+
 class SignatureSha256EcdsaTimeFixture : public IdentityManagementTimeFixture
 {
 public:
@@ -45,26 +48,26 @@
 BOOST_FIXTURE_TEST_SUITE(TestSignatureSha256WithEcdsa, SignatureSha256EcdsaTimeFixture)
 
 const uint8_t sigInfo[] = {
-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
+  0x16, 0x1b, // SignatureInfo
+    0x1b, 0x01, // SignatureType
+      0x03,
+    0x1c, 0x16, // KeyLocator
+      0x07, 0x14, // Name: /test/key/locator
+        0x08, 0x04,
+          0x74, 0x65, 0x73, 0x74,
+        0x08, 0x03,
+          0x6b, 0x65, 0x79,
+        0x08, 0x07,
+          0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
 };
 
 const uint8_t sigValue[] = {
-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
+  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
 };
 
 
@@ -104,75 +107,47 @@
 
 BOOST_AUTO_TEST_CASE(DataSignature)
 {
-  Name identityName("/SecurityTestSignatureSha256WithEcdsa/DataSignature");
-  addIdentity(identityName, EcdsaKeyParams());
-  shared_ptr<security::v1::PublicKey> publicKey;
-  BOOST_REQUIRE_NO_THROW(publicKey = m_keyChain.getPublicKeyFromTpm(
-    m_keyChain.getDefaultKeyNameForIdentity(identityName)));
+  Identity identity = addIdentity("/SecurityTestSignatureSha256WithEcdsa/DataSignature", EcdsaKeyParams());
 
   Data testData("/SecurityTestSignatureSha256WithEcdsa/DataSignature/Data1");
   char content[5] = "1234";
   testData.setContent(reinterpret_cast<uint8_t*>(content), 5);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(testData,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identityName)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(testData, security::SigningInfo(identity)));
   Block dataBlock(testData.wireEncode().wire(), testData.wireEncode().size());
 
   Data testData2;
   testData2.wireDecode(dataBlock);
-  BOOST_CHECK(Validator::verifySignature(testData2, *publicKey));
+  BOOST_CHECK(v2::Validator::verifySignature(testData2, identity.getDefaultKey().getPublicKey()));
 }
 
 BOOST_AUTO_TEST_CASE(InterestSignature)
 {
-  Name identityName("/SecurityTestSignatureSha256WithEcdsa/InterestSignature");
-  addIdentity(identityName, EcdsaKeyParams());
-  shared_ptr<security::v1::PublicKey> publicKey;
-  BOOST_REQUIRE_NO_THROW(publicKey = m_keyChain.getPublicKeyFromTpm(
-    m_keyChain.getDefaultKeyNameForIdentity(identityName)));
-
+  Identity identity = addIdentity("/SecurityTestSignatureSha256WithEcdsa/InterestSignature", EcdsaKeyParams());
 
   Interest interest("/SecurityTestSignatureSha256WithEcdsa/InterestSignature/Interest1");
   Interest interest11("/SecurityTestSignatureSha256WithEcdsa/InterestSignature/Interest1");
 
   scheduler.scheduleEvent(time::milliseconds(100), [&] {
-      BOOST_CHECK_NO_THROW(m_keyChain.sign(interest,
-                                           security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                                 identityName)));
+      BOOST_CHECK_NO_THROW(m_keyChain.sign(interest, security::SigningInfo(identity)));
     });
 
   advanceClocks(time::milliseconds(100));
   scheduler.scheduleEvent(time::milliseconds(100), [&] {
-      BOOST_CHECK_NO_THROW(m_keyChain.sign(interest11,
-                                           security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                                 identityName)));
+      BOOST_CHECK_NO_THROW(m_keyChain.sign(interest11, security::SigningInfo(identity)));
     });
 
   advanceClocks(time::milliseconds(100));
 
-  time::system_clock::TimePoint timestamp1 =
-    time::fromUnixTimestamp(
-      time::milliseconds(interest.getName().get(signed_interest::POS_TIMESTAMP).toNumber()));
-
-  time::system_clock::TimePoint timestamp2 =
-    time::fromUnixTimestamp(
-      time::milliseconds(interest11.getName().get(signed_interest::POS_TIMESTAMP).toNumber()));
-
-  BOOST_CHECK_EQUAL(time::milliseconds(100), (timestamp2 - timestamp1));
-
-  uint64_t nonce1 = interest.getName().get(signed_interest::POS_RANDOM_VAL).toNumber();
-  uint64_t nonce2 = interest11.getName().get(signed_interest::POS_RANDOM_VAL).toNumber();
-  BOOST_WARN_NE(nonce1, nonce2);
-
   Block interestBlock(interest.wireEncode().wire(), interest.wireEncode().size());
 
   Interest interest2;
   interest2.wireDecode(interestBlock);
-  BOOST_CHECK(Validator::verifySignature(interest2, *publicKey));
+  BOOST_CHECK(v2::Validator::verifySignature(interest2, identity.getDefaultKey().getPublicKey()));
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestSignatureSha256WithEcdsa
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
+} // namespace security
 } // namespace ndn
