diff --git a/tests/unit-tests/security/v2/key-chain.t.cpp b/tests/unit-tests/security/v2/key-chain.t.cpp
index 8ce962e..f67e30c 100644
--- a/tests/unit-tests/security/v2/key-chain.t.cpp
+++ b/tests/unit-tests/security/v2/key-chain.t.cpp
@@ -24,7 +24,7 @@
 
 #include "boost-test.hpp"
 #include "unit-tests/test-home-env-saver.hpp"
-#include "test-home-fixture.hpp"
+#include "identity-management-fixture.hpp"
 #include "validator.hpp"
 
 namespace ndn {
@@ -168,30 +168,6 @@
   BOOST_CHECK_EQUAL(keyChain.getTpm().getTpmLocator(), "tpm-memory:");
 }
 
-// @TODO Delete after upgrade of the existing management fixture
-class IdentityManagementFixture
-{
-public:
-  IdentityManagementFixture()
-    : m_keyChain("pib-memory:", "tpm-memory:")
-  {
-  }
-
-  Identity
-  addIdentity(const Name& identityName, const KeyParams& params = KeyChain::getDefaultKeyParams())
-  {
-    Identity identity = m_keyChain.createIdentity(identityName, params);
-    m_identities.push_back(identity);
-    return identity;
-  }
-
-protected:
-  KeyChain m_keyChain;
-
-private:
-  std::vector<Identity> m_identities;
-};
-
 BOOST_FIXTURE_TEST_CASE(Management, IdentityManagementFixture)
 {
   Name identityName("/test/id");
@@ -407,8 +383,19 @@
   BOOST_CHECK_EQUAL(m_keyChain.getTpm().hasKey(cert.getKeyName()), false);
 }
 
+BOOST_FIXTURE_TEST_CASE(SelfSignedCertValidity, IdentityManagementFixture)
+{
+  Certificate cert = addIdentity("/Security/V2/TestKeyChain/SelfSignedCertValidity")
+                       .getDefaultKey()
+                       .getDefaultCertificate();
+  BOOST_CHECK(cert.isValid());
+  BOOST_CHECK(cert.isValid(time::system_clock::now() + time::days(10 * 365)));
+  BOOST_CHECK_GT(cert.getValidityPeriod().getPeriod().second,
+                 time::system_clock::now() + time::days(10 * 365));
+}
+
 BOOST_AUTO_TEST_SUITE_END() // TestKeyChain
-BOOST_AUTO_TEST_SUITE_END() // Tmp
+BOOST_AUTO_TEST_SUITE_END() // V2
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/util/time.t.cpp b/tests/unit-tests/util/time.t.cpp
index 74d893c..217eff8 100644
--- a/tests/unit-tests/util/time.t.cpp
+++ b/tests/unit-tests/util/time.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.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,6 +24,7 @@
 #include "boost-test.hpp"
 
 namespace ndn {
+namespace time {
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Util)
@@ -31,58 +32,68 @@
 
 BOOST_AUTO_TEST_CASE(SystemClock)
 {
-  time::system_clock::TimePoint value = time::system_clock::now();
-  time::system_clock::TimePoint referenceTime =
-    time::fromUnixTimestamp(time::milliseconds(1390966967032LL));
+  system_clock::TimePoint value = system_clock::now();
+  system_clock::TimePoint referenceTime = fromUnixTimestamp(milliseconds(1390966967032LL));
 
   BOOST_CHECK_GT(value, referenceTime);
 
-  BOOST_CHECK_EQUAL(time::toIsoString(referenceTime), "20140129T034247.032000");
-  BOOST_CHECK_EQUAL(time::toString(referenceTime), "2014-01-29 03:42:47");
-  BOOST_CHECK_EQUAL(time::toString(referenceTime), "2014-01-29 03:42:47");
+  BOOST_CHECK_EQUAL(toIsoString(referenceTime), "20140129T034247.032000");
+  BOOST_CHECK_EQUAL(toString(referenceTime), "2014-01-29 03:42:47");
+  BOOST_CHECK_EQUAL(toString(referenceTime), "2014-01-29 03:42:47");
 
   // Unfortunately, not all systems has lv_LV locale installed :(
-  // BOOST_CHECK_EQUAL(time::toString(referenceTime, "%Y. gada %d. %B",
+  // BOOST_CHECK_EQUAL(toString(referenceTime, "%Y. gada %d. %B",
   //                                  std::locale("lv_LV.UTF-8")),
   //                   "2014. gada 29. Janvāris");
 
-  BOOST_CHECK_EQUAL(time::toString(referenceTime, "%Y -- %d -- %B",
+  BOOST_CHECK_EQUAL(toString(referenceTime, "%Y -- %d -- %B",
                                    std::locale("C")),
                     "2014 -- 29 -- January");
 
-  BOOST_CHECK_EQUAL(time::fromIsoString("20140129T034247.032000"), referenceTime);
-  BOOST_CHECK_EQUAL(time::fromIsoString("20140129T034247.032000Z"), referenceTime);
-  BOOST_CHECK_EQUAL(time::fromString("2014-01-29 03:42:47"),
-                    time::fromUnixTimestamp(time::seconds(1390966967)));
+  BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000"), referenceTime);
+  BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000Z"), referenceTime);
+  BOOST_CHECK_EQUAL(fromString("2014-01-29 03:42:47"),
+                    fromUnixTimestamp(seconds(1390966967)));
 
   // Unfortunately, not all systems has lv_LV locale installed :(
-  // BOOST_CHECK_EQUAL(time::fromString("2014. gada 29. Janvāris", "%Y. gada %d. %B",
+  // BOOST_CHECK_EQUAL(fromString("2014. gada 29. Janvāris", "%Y. gada %d. %B",
   //                                    std::locale("lv_LV.UTF-8")),
-  //                   time::fromUnixTimestamp(time::seconds(1390953600)));
+  //                   fromUnixTimestamp(seconds(1390953600)));
 
-  BOOST_CHECK_EQUAL(time::fromString("2014 -- 29 -- January", "%Y -- %d -- %B",
+  BOOST_CHECK_EQUAL(fromString("2014 -- 29 -- January", "%Y -- %d -- %B",
                                      std::locale("C")),
-                    time::fromUnixTimestamp(time::seconds(1390953600)));
+                    fromUnixTimestamp(seconds(1390953600)));
 }
 
 BOOST_AUTO_TEST_CASE(SteadyClock)
 {
-  time::steady_clock::TimePoint oldValue = time::steady_clock::now();
+  steady_clock::TimePoint oldValue = steady_clock::now();
   usleep(100);
-  time::steady_clock::TimePoint newValue = time::steady_clock::now();
+  steady_clock::TimePoint newValue = steady_clock::now();
 
   BOOST_CHECK_GT(newValue, oldValue);
 }
 
 BOOST_AUTO_TEST_CASE(Abs)
 {
-  BOOST_CHECK_EQUAL(time::abs(time::nanoseconds(24422)), time::nanoseconds(24422));
-  BOOST_CHECK_EQUAL(time::abs(time::microseconds(0)), time::microseconds(0));
-  BOOST_CHECK_EQUAL(time::abs(time::milliseconds(-15583)), time::milliseconds(15583));
+  BOOST_CHECK_EQUAL(abs(nanoseconds(24422)), nanoseconds(24422));
+  BOOST_CHECK_EQUAL(abs(microseconds(0)), microseconds(0));
+  BOOST_CHECK_EQUAL(abs(milliseconds(-15583)), milliseconds(15583));
+}
+
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(LargeDates, 1)
+BOOST_AUTO_TEST_CASE(LargeDates)
+{
+  system_clock::TimePoint value = fromUnixTimestamp(milliseconds(1390966967032LL));
+  BOOST_CHECK_EQUAL(toIsoString(value), "20140129T034247.032000");
+
+  value += days(365 * 100 + 25 - 1); // 36524 days
+  BOOST_CHECK_EQUAL(toIsoString(value), "21140129T034247.032000");
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestTime
 BOOST_AUTO_TEST_SUITE_END() // Util
 
 } // namespace tests
+} // namespace time
 } // namespace ndn
