Switch to new KeyChain where possible

signed_interest::POS_RANDOM_VAL and signed_interest::POS_TIMESTAMP
constants are deprecated. Use command_interest:: equivalents instead.

This commit also includes fix for the backward compatibility regression
due to move of deprecated TPM/PublicInfo header files.

Change-Id: Ic3b008fc6758f3ac83f191158b6ac0789483f90d
Refs: #3098
diff --git a/tests/unit-tests/util/io.t.cpp b/tests/unit-tests/util/io.t.cpp
index e4dfa63..20e9412 100644
--- a/tests/unit-tests/util/io.t.cpp
+++ b/tests/unit-tests/util/io.t.cpp
@@ -267,18 +267,14 @@
 
 BOOST_FIXTURE_TEST_CASE(IdCert, IdCertFixture)
 {
-  Name identity("/TestIo/IdCert");
-  identity.appendVersion();
-  addIdentity(identity, RsaKeyParams());
-  Name certName = m_keyChain.getDefaultCertificateNameForIdentity(identity);
-  shared_ptr<security::v1::IdentityCertificate> idCert;
-  BOOST_REQUIRE_NO_THROW(idCert = m_keyChain.getCertificate(certName));
+  auto identity = addIdentity("/TestIo/IdCert", RsaKeyParams());
+  const auto& cert = identity.getDefaultKey().getDefaultCertificate();
+  io::save(cert, filename);
 
-  io::save(*idCert, filename);
-  shared_ptr<security::v1::IdentityCertificate> readCert = io::load<security::v1::IdentityCertificate>(filename);
+  auto readCert = io::load<security::v2::Certificate>(filename);
 
   BOOST_REQUIRE(readCert != nullptr);
-  BOOST_CHECK_EQUAL(idCert->getName(), readCert->getName());
+  BOOST_CHECK_EQUAL(cert.getName(), readCert->getName());
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestIo
diff --git a/tests/unit-tests/util/notification-stream.t.cpp b/tests/unit-tests/util/notification-stream.t.cpp
index 8ec6c6f..65522b0 100644
--- a/tests/unit-tests/util/notification-stream.t.cpp
+++ b/tests/unit-tests/util/notification-stream.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016, Regents of the University of California,
+ * Copyright (c) 2013-2017, Regents of the University of California,
  *                          Arizona Board of Regents,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University,
@@ -37,7 +37,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Util)
-BOOST_FIXTURE_TEST_SUITE(TestNotificationStream, ndn::tests::IdentityManagementTimeFixture)
+BOOST_FIXTURE_TEST_SUITE(TestNotificationStream, ndn::tests::IdentityManagementV1TimeFixture)
 
 BOOST_AUTO_TEST_CASE(Post)
 {
diff --git a/tests/unit-tests/util/notification-subscriber.t.cpp b/tests/unit-tests/util/notification-subscriber.t.cpp
index 309afad..5b22e48 100644
--- a/tests/unit-tests/util/notification-subscriber.t.cpp
+++ b/tests/unit-tests/util/notification-subscriber.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016 Regents of the University of California,
+ * Copyright (c) 2013-2017 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -39,7 +39,7 @@
 
 using namespace ndn::tests;
 
-class NotificationSubscriberFixture : public IdentityManagementTimeFixture
+class NotificationSubscriberFixture : public IdentityManagementV1TimeFixture
 {
 public:
   NotificationSubscriberFixture()
diff --git a/tests/unit-tests/util/segment-fetcher.t.cpp b/tests/unit-tests/util/segment-fetcher.t.cpp
index 02ef85b..6d9ea36 100644
--- a/tests/unit-tests/util/segment-fetcher.t.cpp
+++ b/tests/unit-tests/util/segment-fetcher.t.cpp
@@ -40,7 +40,7 @@
 BOOST_AUTO_TEST_SUITE(Util)
 BOOST_AUTO_TEST_SUITE(TestSegmentFetcher)
 
-class Fixture : public IdentityManagementTimeFixture
+class Fixture : public IdentityManagementV1TimeFixture
 {
 public:
   Fixture()