diff --git a/tests/unit-tests/security/pib/identity.t.cpp b/tests/unit-tests/security/pib/identity.t.cpp
index 5c9a229..3704d92 100644
--- a/tests/unit-tests/security/pib/identity.t.cpp
+++ b/tests/unit-tests/security/pib/identity.t.cpp
@@ -52,8 +52,7 @@
   else
     BOOST_CHECK(true);
 
-  auto pibImpl = make_shared<PibMemory>();
-  id = Identity(id1, pibImpl, true);
+  id = Identity(id1, make_shared<PibMemory>(), true);
 
   BOOST_CHECK_EQUAL(static_cast<bool>(id), true);
   BOOST_CHECK_EQUAL(!id, false);
@@ -66,9 +65,7 @@
 
 BOOST_AUTO_TEST_CASE(KeyOperations)
 {
-  auto pibImpl = make_shared<PibMemory>();
-
-  Identity identity1(id1, pibImpl, true);
+  Identity identity1(id1, make_shared<PibMemory>(), true);
 
   // Key does not exist, throw Error
   BOOST_CHECK_THROW(identity1.getKey(id1Key1Name), Pib::Error);
diff --git a/tests/unit-tests/security/pib/key.t.cpp b/tests/unit-tests/security/pib/key.t.cpp
index 6a543f6..9391f53 100644
--- a/tests/unit-tests/security/pib/key.t.cpp
+++ b/tests/unit-tests/security/pib/key.t.cpp
@@ -78,10 +78,7 @@
   BOOST_REQUIRE_NO_THROW(key11.getDefaultCertificate());
 
   const auto& defaultCert = key11.getDefaultCertificate();
-  BOOST_CHECK_EQUAL_COLLECTIONS(defaultCert.wireEncode().wire(),
-                                defaultCert.wireEncode().wire() + defaultCert.wireEncode().size(),
-                                id1Key1Cert1.wireEncode().wire(),
-                                id1Key1Cert1.wireEncode().wire() + id1Key1Cert1.wireEncode().size());
+  BOOST_CHECK(defaultCert.wireEncode() == id1Key1Cert1.wireEncode());
 
   key11.removeCertificate(id1Key1Cert1.getName());
   BOOST_CHECK_THROW(key11.getCertificate(id1Key1Cert1.getName()), Pib::Error);
diff --git a/tests/unit-tests/security/pib/pib-impl.t.cpp b/tests/unit-tests/security/pib/pib-impl.t.cpp
index ccf54df..610d657 100644
--- a/tests/unit-tests/security/pib/pib-impl.t.cpp
+++ b/tests/unit-tests/security/pib/pib-impl.t.cpp
@@ -43,192 +43,225 @@
 
 using pib::Pib;
 
-class PibMemoryWrapper
+class PibMemoryFixture : public PibDataFixture
 {
 public:
-  PibMemory impl;
+  PibMemory pib;
 };
 
-class PibSqlite3Wrapper
+class PibSqlite3Fixture : public PibDataFixture
 {
 public:
-  PibSqlite3Wrapper()
+  PibSqlite3Fixture()
     : tmpPath(boost::filesystem::path(UNIT_TEST_CONFIG_PATH) / "DbTest")
-    , impl(tmpPath.c_str())
+    , pib(tmpPath.c_str())
   {
   }
 
-  ~PibSqlite3Wrapper()
+  ~PibSqlite3Fixture()
   {
     boost::filesystem::remove_all(tmpPath);
   }
 
 public:
   boost::filesystem::path tmpPath;
-  PibSqlite3 impl;
+  PibSqlite3 pib;
 };
 
-typedef boost::mpl::list<PibMemoryWrapper,
-                         PibSqlite3Wrapper> PibImpls;
+typedef boost::mpl::list<PibMemoryFixture,
+                         PibSqlite3Fixture> PibImpls;
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(IdentityManagement, T, PibImpls, PibDataFixture)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(TpmLocator, T, PibImpls, T)
 {
-  T wrapper;
-  PibImpl& pibImpl = wrapper.impl;
+  // Basic getting and setting
+  BOOST_CHECK_NO_THROW(this->pib.getTpmLocator());
 
-  // no default setting, throw Error
-  BOOST_CHECK_THROW(pibImpl.getDefaultIdentity(), Pib::Error);
+  BOOST_CHECK_NO_THROW(this->pib.setTpmLocator("tpmLocator"));
+  BOOST_CHECK_EQUAL(this->pib.getTpmLocator(), "tpmLocator");
 
-  // check id1, which should not exist
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id1), false);
+  // Add cert, and do not change TPM locator
+  this->pib.addCertificate(this->id1Key1Cert1);
+  BOOST_CHECK(this->pib.hasIdentity(this->id1));
+  BOOST_CHECK(this->pib.hasKey(this->id1Key1Name));
+  BOOST_CHECK(this->pib.hasCertificate(this->id1Key1Cert1.getName()));
 
-  // add id1, should be default
-  pibImpl.addIdentity(id1);
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id1), true);
-  BOOST_CHECK_NO_THROW(pibImpl.getDefaultIdentity());
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultIdentity(), id1);
+  // Set TPM locator to the same value, nothing should change
+  this->pib.setTpmLocator("tpmLocator");
+  BOOST_CHECK(this->pib.hasIdentity(this->id1));
+  BOOST_CHECK(this->pib.hasKey(this->id1Key1Name));
+  BOOST_CHECK(this->pib.hasCertificate(this->id1Key1Cert1.getName()));
 
-  // add id2, should not be default
-  pibImpl.addIdentity(id2);
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id2), true);
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultIdentity(), id1);
-
-  // set id2 explicitly as default
-  pibImpl.setDefaultIdentity(id2);
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultIdentity(), id2);
-
-  // remove id2, should not have default identity
-  pibImpl.removeIdentity(id2);
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id2), false);
-  BOOST_CHECK_THROW(pibImpl.getDefaultIdentity(), Pib::Error);
-
-  // add id2 again, should be default
-  pibImpl.addIdentity(id2);
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultIdentity(), id2);
-
-  // get all identities, should contain id1 and id2
-  std::set<Name> idNames = pibImpl.getIdentities();
-  BOOST_CHECK_EQUAL(idNames.size(), 2);
-  BOOST_CHECK_EQUAL(idNames.count(id1), 1);
-  BOOST_CHECK_EQUAL(idNames.count(id2), 1);
+  // Change TPM locator (contents of PIB should not change)
+  this->pib.setTpmLocator("newTpmLocator");
+  BOOST_CHECK(this->pib.hasIdentity(this->id1));
+  BOOST_CHECK(this->pib.hasKey(this->id1Key1Name));
+  BOOST_CHECK(this->pib.hasCertificate(this->id1Key1Cert1.getName()));
 }
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(KeyManagement, T, PibImpls, PibDataFixture)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(IdentityManagement, T, PibImpls, T)
 {
-  T wrapper;
-  PibImpl& pibImpl = wrapper.impl;
-
   // no default setting, throw Error
-  BOOST_CHECK_THROW(pibImpl.getDefaultKeyOfIdentity(id1), Pib::Error);
+  BOOST_CHECK_THROW(this->pib.getDefaultIdentity(), Pib::Error);
+
+  // check id1, which should not exist
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), false);
+
+  // add id1, should be default
+  this->pib.addIdentity(this->id1);
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), true);
+  BOOST_CHECK_NO_THROW(this->pib.getDefaultIdentity());
+  BOOST_CHECK_EQUAL(this->pib.getDefaultIdentity(), this->id1);
+
+  // add id2, should not be default
+  this->pib.addIdentity(this->id2);
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id2), true);
+  BOOST_CHECK_EQUAL(this->pib.getDefaultIdentity(), this->id1);
+
+  // set id2 explicitly as default
+  this->pib.setDefaultIdentity(this->id2);
+  BOOST_CHECK_EQUAL(this->pib.getDefaultIdentity(), this->id2);
+
+  // remove id2, should not have default identity
+  this->pib.removeIdentity(this->id2);
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id2), false);
+  BOOST_CHECK_THROW(this->pib.getDefaultIdentity(), Pib::Error);
+
+  // add id2 again, should be default
+  this->pib.addIdentity(this->id2);
+  BOOST_CHECK_EQUAL(this->pib.getDefaultIdentity(), this->id2);
+
+  // get all identities, should contain id1 and id2
+  std::set<Name> idNames = this->pib.getIdentities();
+  BOOST_CHECK_EQUAL(idNames.size(), 2);
+  BOOST_CHECK_EQUAL(idNames.count(this->id1), 1);
+  BOOST_CHECK_EQUAL(idNames.count(this->id2), 1);
+}
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(ClearIdentities, T, PibImpls, T)
+{
+  this->pib.setTpmLocator("tpmLocator");
+
+  // Add id, key, and cert
+  this->pib.addCertificate(this->id1Key1Cert1);
+  BOOST_CHECK(this->pib.hasIdentity(this->id1));
+  BOOST_CHECK(this->pib.hasKey(this->id1Key1Name));
+  BOOST_CHECK(this->pib.hasCertificate(this->id1Key1Cert1.getName()));
+
+  // Clear identities
+  this->pib.clearIdentities();
+  BOOST_CHECK_EQUAL(this->pib.getIdentities().size(), 0);
+  BOOST_CHECK_EQUAL(this->pib.getKeysOfIdentity(this->id1).size(), 0);
+  BOOST_CHECK_EQUAL(this->pib.getCertificatesOfKey(this->id1Key1Name).size(), 0);
+  BOOST_CHECK_EQUAL(this->pib.getTpmLocator(), "tpmLocator");
+}
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(KeyManagement, T, PibImpls, T)
+{
+  // no default setting, throw Error
+  BOOST_CHECK_THROW(this->pib.getDefaultKeyOfIdentity(this->id1), Pib::Error);
 
   // check id1Key1, should not exist, neither should id1.
-  BOOST_CHECK_EQUAL(pibImpl.hasKey(id1Key1Name), false);
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id1), false);
+  BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key1Name), false);
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), false);
 
   // add id1Key1, should be default, id1 should be added implicitly
-  pibImpl.addKey(id1, id1Key1Name, id1Key1.buf(), id1Key1.size());
-  BOOST_CHECK_EQUAL(pibImpl.hasKey(id1Key1Name), true);
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id1), true);
-  const Buffer& keyBits = pibImpl.getKeyBits(id1Key1Name);
-  BOOST_CHECK_EQUAL_COLLECTIONS(keyBits.begin(), keyBits.end(), id1Key1.begin(), id1Key1.end());
-  BOOST_CHECK_NO_THROW(pibImpl.getDefaultKeyOfIdentity(id1));
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultKeyOfIdentity(id1), id1Key1Name);
+  this->pib.addKey(this->id1, this->id1Key1Name, this->id1Key1.buf(), this->id1Key1.size());
+  BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key1Name), true);
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), true);
+  const Buffer& keyBits = this->pib.getKeyBits(this->id1Key1Name);
+  BOOST_CHECK_EQUAL_COLLECTIONS(keyBits.begin(), keyBits.end(), this->id1Key1.begin(), this->id1Key1.end());
+  BOOST_CHECK_NO_THROW(this->pib.getDefaultKeyOfIdentity(this->id1));
+  BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id1), this->id1Key1Name);
 
   // add id1Key2, should not be default
-  pibImpl.addKey(id1, id1Key2Name, id1Key2.buf(), id1Key2.size());
-  BOOST_CHECK_EQUAL(pibImpl.hasKey(id1Key2Name), true);
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultKeyOfIdentity(id1), id1Key1Name);
+  this->pib.addKey(this->id1, this->id1Key2Name, this->id1Key2.buf(), this->id1Key2.size());
+  BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key2Name), true);
+  BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id1), this->id1Key1Name);
 
   // set id1Key2 explicitly as default
-  pibImpl.setDefaultKeyOfIdentity(id1, id1Key2Name);
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultKeyOfIdentity(id1), id1Key2Name);
+  this->pib.setDefaultKeyOfIdentity(this->id1, this->id1Key2Name);
+  BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id1), this->id1Key2Name);
 
   // set a non-existing key as default, throw Error
-  BOOST_CHECK_THROW(pibImpl.setDefaultKeyOfIdentity(id1, Name("/non-existing")),
+  BOOST_CHECK_THROW(this->pib.setDefaultKeyOfIdentity(this->id1, Name("/non-existing")),
                     Pib::Error);
 
   // remove id1Key2, should not have default key
-  pibImpl.removeKey(id1Key2Name);
-  BOOST_CHECK_EQUAL(pibImpl.hasKey(id1Key2Name), false);
-  BOOST_CHECK_THROW(pibImpl.getKeyBits(id1Key2Name), Pib::Error);
-  BOOST_CHECK_THROW(pibImpl.getDefaultKeyOfIdentity(id1), Pib::Error);
+  this->pib.removeKey(this->id1Key2Name);
+  BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key2Name), false);
+  BOOST_CHECK_THROW(this->pib.getKeyBits(this->id1Key2Name), Pib::Error);
+  BOOST_CHECK_THROW(this->pib.getDefaultKeyOfIdentity(this->id1), Pib::Error);
 
   // add id1Key2 back, should be default
-  pibImpl.addKey(id1, id1Key2Name, id1Key2.buf(), id1Key2.size());
-  BOOST_CHECK_NO_THROW(pibImpl.getKeyBits(id1Key2Name));
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultKeyOfIdentity(id1), id1Key2Name);
+  this->pib.addKey(this->id1, this->id1Key2Name, this->id1Key2.buf(), this->id1Key2.size());
+  BOOST_CHECK_NO_THROW(this->pib.getKeyBits(this->id1Key2Name));
+  BOOST_CHECK_EQUAL(this->pib.getDefaultKeyOfIdentity(this->id1), this->id1Key2Name);
 
   // get all the keys: id1Key1 and id1Key2
-  std::set<Name> keyNames = pibImpl.getKeysOfIdentity(id1);
+  std::set<Name> keyNames = this->pib.getKeysOfIdentity(this->id1);
   BOOST_CHECK_EQUAL(keyNames.size(), 2);
-  BOOST_CHECK_EQUAL(keyNames.count(id1Key1Name), 1);
-  BOOST_CHECK_EQUAL(keyNames.count(id1Key2Name), 1);
+  BOOST_CHECK_EQUAL(keyNames.count(this->id1Key1Name), 1);
+  BOOST_CHECK_EQUAL(keyNames.count(this->id1Key2Name), 1);
 
   // remove id1, should remove all the keys
-  pibImpl.removeIdentity(id1);
-  keyNames = pibImpl.getKeysOfIdentity(id1);
+  this->pib.removeIdentity(this->id1);
+  keyNames = this->pib.getKeysOfIdentity(this->id1);
   BOOST_CHECK_EQUAL(keyNames.size(), 0);
 }
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(CertificateManagement, T, PibImpls, PibDataFixture)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(CertificateManagement, T, PibImpls, T)
 {
-  T wrapper;
-  PibImpl& pibImpl = wrapper.impl;
-
   // no default setting, throw Error
-  BOOST_CHECK_THROW(pibImpl.getDefaultCertificateOfKey(id1Key1Name), Pib::Error);
+  BOOST_CHECK_THROW(this->pib.getDefaultCertificateOfKey(this->id1Key1Name), Pib::Error);
 
   // check id1Key1Cert1, should not exist, neither should id1 and id1Key1
-  BOOST_CHECK_EQUAL(pibImpl.hasCertificate(id1Key1Cert1.getName()), false);
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id1), false);
-  BOOST_CHECK_EQUAL(pibImpl.hasKey(id1Key1Name), false);
+  BOOST_CHECK_EQUAL(this->pib.hasCertificate(this->id1Key1Cert1.getName()), false);
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), false);
+  BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key1Name), false);
 
   // add id1Key1Cert1, should be default, id1 and id1Key1 should be added implicitly
-  pibImpl.addCertificate(id1Key1Cert1);
-  BOOST_CHECK_EQUAL(pibImpl.hasCertificate(id1Key1Cert1.getName()), true);
-  BOOST_CHECK_EQUAL(pibImpl.hasIdentity(id1), true);
-  BOOST_CHECK_EQUAL(pibImpl.hasKey(id1Key1Name), true);
-  const auto& cert = pibImpl.getCertificate(id1Key1Cert1.getName());
-  BOOST_CHECK_EQUAL_COLLECTIONS(cert.wireEncode().wire(),
-                                cert.wireEncode().wire() + cert.wireEncode().size(),
-                                id1Key1Cert1.wireEncode().wire(),
-                                id1Key1Cert1.wireEncode().wire() + id1Key1Cert1.wireEncode().size());
-  BOOST_CHECK_NO_THROW(pibImpl.getDefaultCertificateOfKey(id1Key1Name));
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultCertificateOfKey(id1Key1Name), id1Key1Cert1);
+  this->pib.addCertificate(this->id1Key1Cert1);
+  BOOST_CHECK_EQUAL(this->pib.hasCertificate(this->id1Key1Cert1.getName()), true);
+  BOOST_CHECK_EQUAL(this->pib.hasIdentity(this->id1), true);
+  BOOST_CHECK_EQUAL(this->pib.hasKey(this->id1Key1Name), true);
+  const auto& cert = this->pib.getCertificate(this->id1Key1Cert1.getName());
+  BOOST_CHECK(cert.wireEncode() == this->id1Key1Cert1.wireEncode());
+  BOOST_CHECK_NO_THROW(this->pib.getDefaultCertificateOfKey(this->id1Key1Name));
+  BOOST_CHECK_EQUAL(this->pib.getDefaultCertificateOfKey(this->id1Key1Name), this->id1Key1Cert1);
 
   // add id1Key1Cert2, should not be default
-  pibImpl.addCertificate(id1Key1Cert2);
-  BOOST_CHECK_EQUAL(pibImpl.hasCertificate(id1Key1Cert2.getName()), true);
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultCertificateOfKey(id1Key1Name), id1Key1Cert1);
+  this->pib.addCertificate(this->id1Key1Cert2);
+  BOOST_CHECK_EQUAL(this->pib.hasCertificate(this->id1Key1Cert2.getName()), true);
+  BOOST_CHECK_EQUAL(this->pib.getDefaultCertificateOfKey(this->id1Key1Name), this->id1Key1Cert1);
 
   // set id1Key1Cert2 explicitly as default
-  pibImpl.setDefaultCertificateOfKey(id1Key1Name, id1Key1Cert2.getName());
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultCertificateOfKey(id1Key1Name), id1Key1Cert2);
+  this->pib.setDefaultCertificateOfKey(this->id1Key1Name, this->id1Key1Cert2.getName());
+  BOOST_CHECK_EQUAL(this->pib.getDefaultCertificateOfKey(this->id1Key1Name), this->id1Key1Cert2);
 
   // set a non-existing cert as default, throw Error
-  BOOST_CHECK_THROW(pibImpl.setDefaultCertificateOfKey(id1Key1Name, Name("/non-existing")),
+  BOOST_CHECK_THROW(this->pib.setDefaultCertificateOfKey(this->id1Key1Name, Name("/non-existing")),
                     Pib::Error);
 
   // remove id1Key1Cert2, should not have default cert
-  pibImpl.removeCertificate(id1Key1Cert2.getName());
-  BOOST_CHECK_EQUAL(pibImpl.hasCertificate(id1Key1Cert2.getName()), false);
-  BOOST_CHECK_THROW(pibImpl.getCertificate(id1Key1Cert2.getName()), Pib::Error);
-  BOOST_CHECK_THROW(pibImpl.getDefaultCertificateOfKey(id1Key1Name), Pib::Error);
+  this->pib.removeCertificate(this->id1Key1Cert2.getName());
+  BOOST_CHECK_EQUAL(this->pib.hasCertificate(this->id1Key1Cert2.getName()), false);
+  BOOST_CHECK_THROW(this->pib.getCertificate(this->id1Key1Cert2.getName()), Pib::Error);
+  BOOST_CHECK_THROW(this->pib.getDefaultCertificateOfKey(this->id1Key1Name), Pib::Error);
 
   // add id1Key1Cert2, should be default
-  pibImpl.addCertificate(id1Key1Cert2);
-  BOOST_CHECK_NO_THROW(pibImpl.getCertificate(id1Key1Cert1.getName()));
-  BOOST_CHECK_EQUAL(pibImpl.getDefaultCertificateOfKey(id1Key1Name), id1Key1Cert2);
+  this->pib.addCertificate(this->id1Key1Cert2);
+  BOOST_CHECK_NO_THROW(this->pib.getCertificate(this->id1Key1Cert1.getName()));
+  BOOST_CHECK_EQUAL(this->pib.getDefaultCertificateOfKey(this->id1Key1Name), this->id1Key1Cert2);
 
   // get all certificates: id1Key1Cert1 and id1Key1Cert2
-  std::set<Name> certNames = pibImpl.getCertificatesOfKey(id1Key1Name);
+  std::set<Name> certNames = this->pib.getCertificatesOfKey(this->id1Key1Name);
   BOOST_CHECK_EQUAL(certNames.size(), 2);
-  BOOST_CHECK_EQUAL(certNames.count(id1Key1Cert1.getName()), 1);
-  BOOST_CHECK_EQUAL(certNames.count(id1Key1Cert2.getName()), 1);
+  BOOST_CHECK_EQUAL(certNames.count(this->id1Key1Cert1.getName()), 1);
+  BOOST_CHECK_EQUAL(certNames.count(this->id1Key1Cert2.getName()), 1);
 
   // remove id1Key1, should remove all the certs
-  pibImpl.removeKey(id1Key1Name);
-  certNames = pibImpl.getCertificatesOfKey(id1Key1Name);
+  this->pib.removeKey(this->id1Key1Name);
+  certNames = this->pib.getCertificatesOfKey(this->id1Key1Name);
   BOOST_CHECK_EQUAL(certNames.size(), 0);
 }
 
diff --git a/tests/unit-tests/security/pib/pib-memory.t.cpp b/tests/unit-tests/security/pib/pib-memory.t.cpp
index b8bfb62..89cf198 100644
--- a/tests/unit-tests/security/pib/pib-memory.t.cpp
+++ b/tests/unit-tests/security/pib/pib-memory.t.cpp
@@ -28,18 +28,11 @@
 namespace pib {
 namespace tests {
 
-// most functionalities are tested in pib-impl.t.cpp
 BOOST_AUTO_TEST_SUITE(Security)
 BOOST_AUTO_TEST_SUITE(Pib)
 BOOST_AUTO_TEST_SUITE(TestPibMemory)
 
-BOOST_AUTO_TEST_CASE(TpmLocatorManagement)
-{
-  PibMemory pibImpl;
-
-  BOOST_CHECK_EQUAL(pibImpl.getTpmLocator(), "tpm-memory:");
-  BOOST_CHECK_THROW(pibImpl.setTpmLocator(""), PibImpl::Error);
-}
+// Functionality is tested as part of pib-impl.t.cpp
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibMemory
 BOOST_AUTO_TEST_SUITE_END() // Pib
diff --git a/tests/unit-tests/security/pib/pib-sqlite3.t.cpp b/tests/unit-tests/security/pib/pib-sqlite3.t.cpp
index aec65a1..966926d 100644
--- a/tests/unit-tests/security/pib/pib-sqlite3.t.cpp
+++ b/tests/unit-tests/security/pib/pib-sqlite3.t.cpp
@@ -20,12 +20,9 @@
  */
 
 #include "security/pib/pib-sqlite3.hpp"
-#include "security/pib/pib.hpp"
 
 #include "boost-test.hpp"
 
-#include <boost/filesystem.hpp>
-
 namespace ndn {
 namespace security {
 namespace pib {
@@ -33,95 +30,9 @@
 
 BOOST_AUTO_TEST_SUITE(Security)
 BOOST_AUTO_TEST_SUITE(Pib)
+BOOST_AUTO_TEST_SUITE(TestPibSqlite3)
 
-class PibSqlite3TestFixture
-{
-public:
-  PibSqlite3TestFixture()
-    : m_path(boost::filesystem::path(UNIT_TEST_CONFIG_PATH) / "DbTest")
-    , impl(m_path.c_str())
-  {
-  }
-
-  ~PibSqlite3TestFixture()
-  {
-    boost::filesystem::remove_all(m_path);
-  }
-
-private:
-  boost::filesystem::path m_path;
-
-public:
-  PibSqlite3 impl;
-};
-
-BOOST_FIXTURE_TEST_SUITE(TestPibSqlite3, PibSqlite3TestFixture)
-
-using pib::Pib;
-
-// most functionalities are tested in pib-impl.t.cpp
-
-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
-};
-
-BOOST_AUTO_TEST_CASE(TpmTest)
-{
-  Block selfSignedCertBlock(SELF_SIGNED_ECDSA_CERT, sizeof(SELF_SIGNED_ECDSA_CERT));
-  v2::Certificate cert;
-  cert.wireDecode(selfSignedCertBlock);
-  Name identity = cert.getIdentity();
-  Name keyName = cert.getKeyName();
-  Name certName = cert.getName();
-
-  // Basic getting and setting
-  BOOST_REQUIRE_THROW(impl.getTpmLocator(), Pib::Error);
-  impl.setTpmLocator("tpmLocator");
-  BOOST_CHECK_EQUAL(impl.getTpmLocator(), "tpmLocator");
-
-  // Add cert, and do not change tpmLocator
-  impl.addCertificate(cert);
-  BOOST_CHECK(impl.hasIdentity(identity));
-  BOOST_CHECK(impl.hasKey(keyName));
-  BOOST_CHECK(impl.hasCertificate(certName));
-
-  // Set tpmLocator with the existing value, nothing should change.
-  impl.setTpmLocator("tpmLocator");
-  BOOST_CHECK(impl.hasIdentity(identity));
-  BOOST_CHECK(impl.hasKey(keyName));
-  BOOST_CHECK(impl.hasCertificate(certName));
-
-  // Change tpmLocator and ensure the pib is reset
-  impl.setTpmLocator("newTpmLocator");
-  BOOST_CHECK_EQUAL(impl.getTpmLocator(), "newTpmLocator");
-
-  BOOST_CHECK_EQUAL(impl.getIdentities().size(), 0);
-  BOOST_CHECK_EQUAL(impl.getKeysOfIdentity(identity).size(), 0);
-  BOOST_CHECK_EQUAL(impl.getCertificatesOfKey(keyName).size(), 0);
-}
+// Functionality is tested as part of pib-impl.t.cpp
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibSqlite3
 BOOST_AUTO_TEST_SUITE_END() // Pib
diff --git a/tests/unit-tests/security/pib/pib.t.cpp b/tests/unit-tests/security/pib/pib.t.cpp
index 97e8568..f947fed 100644
--- a/tests/unit-tests/security/pib/pib.t.cpp
+++ b/tests/unit-tests/security/pib/pib.t.cpp
@@ -34,18 +34,17 @@
 
 BOOST_AUTO_TEST_SUITE(Security)
 BOOST_AUTO_TEST_SUITE(Pib)
-BOOST_FIXTURE_TEST_SUITE(Common, PibDataFixture)
+BOOST_FIXTURE_TEST_SUITE(TestPib, PibDataFixture)
 
 using pib::Pib;
 
 BOOST_AUTO_TEST_CASE(ValidityChecking)
 {
-  auto pibImpl = make_shared<PibMemory>();
-  Pib pib("pib-memory", "", pibImpl);
+  Pib pib("pib-memory", "", make_shared<PibMemory>());
 
   Identity id = pib.addIdentity(id1);
 
-  BOOST_CHECK_EQUAL(bool(id), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(id), true);
   BOOST_CHECK_EQUAL(!id, false);
 
   if (id)
@@ -56,7 +55,7 @@
   // key
   Key key = id.addKey(id1Key1.buf(), id1Key1.size(), id1Key1Name);
 
-  BOOST_CHECK_EQUAL(bool(key), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(key), true);
   BOOST_CHECK_EQUAL(!key, false);
 
   if (key)
@@ -65,10 +64,33 @@
     BOOST_CHECK(false);
 }
 
+BOOST_AUTO_TEST_CASE(TpmLocator)
+{
+  Pib pib("pib-memory", "", make_shared<PibMemory>());
+
+  BOOST_CHECK_EQUAL(pib.getPibLocator(), "pib-memory:");
+  BOOST_CHECK_THROW(pib.getTpmLocator(), Pib::Error);
+
+  pib.setTpmLocator("test-tpm-locator");
+  BOOST_CHECK_NO_THROW(pib.getTpmLocator());
+
+  BOOST_CHECK_THROW(pib.getIdentity(id1), Pib::Error);
+  pib.addIdentity(id1);
+  BOOST_CHECK_NO_THROW(pib.getIdentity(id1));
+
+  pib.setTpmLocator("another-tpm-locator");
+  BOOST_CHECK_THROW(pib.getIdentity(id1), Pib::Error);
+
+  pib.addIdentity(id1);
+  BOOST_CHECK_NO_THROW(pib.getIdentity(id1));
+  pib.reset();
+  BOOST_CHECK_THROW(pib.getIdentity(id1), Pib::Error);
+  BOOST_CHECK_THROW(pib.getTpmLocator(), Pib::Error);
+}
+
 BOOST_AUTO_TEST_CASE(IdentityOperations)
 {
-  auto pibImpl = make_shared<PibMemory>();
-  Pib pib("pib-memory", "", pibImpl);
+  Pib pib("pib-memory", "", make_shared<PibMemory>());
 
   BOOST_CHECK_THROW(pib.getIdentity(id1), Pib::Error);
   Identity identity1 = pib.addIdentity(id1);
@@ -85,7 +107,7 @@
   BOOST_CHECK_THROW(pib.getDefaultIdentity(), Pib::Error);
 }
 
-BOOST_AUTO_TEST_SUITE_END() // Common
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Pib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
