diff --git a/tests/chunks/producer.t.cpp b/tests/chunks/producer.t.cpp
index dc5346f..d3c339f 100644
--- a/tests/chunks/producer.t.cpp
+++ b/tests/chunks/producer.t.cpp
@@ -1,8 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2016,  Regents of the University of California,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University.
+ * Copyright (c) 2016-2017,  Regents of the University of California,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -25,28 +25,52 @@
 
 #include "tools/chunks/putchunks/producer.hpp"
 
-#include "tests/test-common.hpp"
+#include <ndn-cxx/security/pib/identity.hpp>
+#include <ndn-cxx/security/pib/key.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
-#include <ndn-cxx/security/validator-null.hpp>
-
 #include <cmath>
 
+#include "tests/test-common.hpp"
+#include "tests/identity-management-fixture.hpp"
+
 namespace ndn {
 namespace chunks {
 namespace tests {
 
 using namespace ndn::tests;
 
+class ProducerFixture : public IdentityManagementFixture
+{
+protected:
+  ProducerFixture()
+    : face(io, {true, true})
+    , prefix("/ndn/chunks/test")
+    , testString(std::string(
+        "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget "
+        "dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, "
+        "nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, "
+        "sem. Nulla consequat massa Donec pede justo,"))
+    ,keyLocatorName(m_keyChain.createIdentity("/ProducerFixture").getDefaultKey().getName())
+  {
+  }
+
+protected:
+  boost::asio::io_service io;
+  util::DummyClientFace face;
+  security::SigningInfo signingInfo;
+  Name prefix;
+  time::milliseconds freshnessPeriod = time::seconds(10);
+  size_t maxSegmentSize = 40;
+  std::istringstream testString;
+  uint64_t version = 1449227841747;
+  Name keyLocatorName;
+};
+
 BOOST_AUTO_TEST_SUITE(Chunks)
-BOOST_AUTO_TEST_SUITE(TestProducer)
+BOOST_FIXTURE_TEST_SUITE(TestProducer, ProducerFixture)
 
 BOOST_AUTO_TEST_CASE(InputData)
 {
-  util::DummyClientFace face;
-  KeyChain keyChain;
-  security::SigningInfo signingInfo;
-  Name prefix("/ndn/chunks/test");
-  int maxSegmentSize = 40;
   std::vector<std::string> testStrings {
       "",
 
@@ -63,7 +87,7 @@
 
   for (size_t i = 0; i <  testStrings.size(); ++i) {
     std::istringstream str(testStrings[i]);
-    Producer prod(prefix, face, keyChain, signingInfo, time::seconds(4), maxSegmentSize, false,
+    Producer prod(prefix, face, m_keyChain, signingInfo, time::seconds(4), maxSegmentSize, false,
                   false, str);
 
     size_t expectedSize = std::ceil(static_cast<double>(testStrings[i].size()) / maxSegmentSize);
@@ -76,22 +100,7 @@
 
 BOOST_AUTO_TEST_CASE(RequestSegmentUnspecifiedVersion)
 {
-  boost::asio::io_service io;
-  util::DummyClientFace face(io, {true, true});
-  KeyChain keyChain;
-  security::SigningInfo signingInfo;
-  Name prefix("/ndn/chunks/test");
-  time::milliseconds freshnessPeriod(time::seconds(10));
-  size_t maxSegmentSize(40);
-  std::istringstream testString(std::string(
-          "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget "
-          "dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, "
-          "nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, "
-          "sem. Nulla consequat massa Donec pede justo,"));
-
-  Name keyLocatorName = keyChain.getDefaultCertificateName().getPrefix(-1);
-
-  Producer producer(prefix, face, keyChain, signingInfo, freshnessPeriod, maxSegmentSize,
+  Producer producer(prefix, face, m_keyChain, signingInfo, freshnessPeriod, maxSegmentSize,
                     false, false, testString);
   io.poll();
 
@@ -128,23 +137,7 @@
 
 BOOST_AUTO_TEST_CASE(RequestSegmentSpecifiedVersion)
 {
-  boost::asio::io_service io;
-  util::DummyClientFace face(io, {true, true});
-  KeyChain keyChain;
-  security::SigningInfo signingInfo;
-  Name prefix("/ndn/chunks/test");
-  time::milliseconds freshnessPeriod(time::seconds(10));
-  size_t maxSegmentSize(40);
-  std::istringstream testString(std::string(
-          "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget "
-          "dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, "
-          "nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, "
-          "sem. Nulla consequat massa Donec pede justo,"));
-
-  uint64_t version = 1449227841747;
-  Name keyLocatorName = keyChain.getDefaultCertificateName().getPrefix(-1);
-
-  Producer producer(prefix.appendVersion(version), face, keyChain, signingInfo, freshnessPeriod,
+  Producer producer(prefix.appendVersion(version), face, m_keyChain, signingInfo, freshnessPeriod,
                     maxSegmentSize, false, false, testString);
   io.poll();
 
@@ -182,22 +175,7 @@
 
 BOOST_AUTO_TEST_CASE(RequestNotExistingSegment)
 {
-  boost::asio::io_service io;
-  util::DummyClientFace face(io, {true, true});
-  KeyChain keyChain;
-  security::SigningInfo signingInfo;
-  Name prefix("/ndn/chunks/test");
-  time::milliseconds freshnessPeriod(time::seconds(10));
-  size_t maxSegmentSize(40);
-  std::istringstream testString(std::string(
-          "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget "
-          "dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, "
-          "nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, "
-          "sem. Nulla consequat massa Donec pede justo,"));
-
-  Name keyLocatorName = keyChain.getDefaultCertificateName().getPrefix(-1);
-
-  Producer producer(prefix, face, keyChain, signingInfo, freshnessPeriod, maxSegmentSize,
+  Producer producer(prefix, face, m_keyChain, signingInfo, freshnessPeriod, maxSegmentSize,
                     false, false, testString);
   io.poll();
 
diff --git a/tests/dump/ndndump.t.cpp b/tests/dump/ndndump.t.cpp
index d4b8396..b360bd9 100644
--- a/tests/dump/ndndump.t.cpp
+++ b/tests/dump/ndndump.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  University of Memphis.
+ * Copyright (c) 2014-2017,  University of Memphis.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -19,14 +19,14 @@
 
 #include "tools/dump/ndndump.hpp"
 
-#include "tests/test-common.hpp"
-
-#include <boost/test/output_test_stream.hpp>
-
 #include <ndn-cxx/lp/packet.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
 #include <ndn-cxx/util/ethernet.hpp>
 
+#include "tests/test-common.hpp"
+#include "tests/identity-management-fixture.hpp"
+#include <boost/test/output_test_stream.hpp>
+
 namespace ndn {
 namespace dump {
 namespace tests {
@@ -52,7 +52,7 @@
   std::streambuf* originalBuffer;
 };
 
-class NdnDumpFixture
+class NdnDumpFixture : public IdentityManagementFixture
 {
 protected:
   NdnDumpFixture()
@@ -60,23 +60,23 @@
     dump.m_dataLinkType = DLT_EN10MB;
   }
 
-  template <typename Packet>
+  template<typename Packet>
   void
   receive(const Packet& packet)
   {
-    ndn::EncodingBuffer buffer(packet.wireEncode());
+    EncodingBuffer buffer(packet.wireEncode());
     receive(buffer);
   }
 
   void
-  receive(ndn::EncodingBuffer& buffer)
+  receive(EncodingBuffer& buffer)
   {
-    ndn::util::ethernet::Address host;
+    util::ethernet::Address host;
 
     // Ethernet header
-    uint16_t frameType = htons(ndn::util::ethernet::ETHERTYPE_NDN);
+    uint16_t frameType = htons(util::ethernet::ETHERTYPE_NDN);
     buffer.prependByteArray(reinterpret_cast<const uint8_t*>(&frameType),
-                            ndn::util::ethernet::TYPE_LEN);
+                            util::ethernet::TYPE_LEN);
     buffer.prependByteArray(host.data(), host.size());
     buffer.prependByteArray(host.data(), host.size());
 
@@ -98,7 +98,7 @@
 
 BOOST_AUTO_TEST_CASE(CaptureInterest)
 {
-  ndn::Interest interest("/test");
+  Interest interest("/test");
   interest.setNonce(0);
 
   this->receive(interest);
@@ -111,10 +111,8 @@
 
 BOOST_AUTO_TEST_CASE(CaptureData)
 {
-  ndn::security::KeyChain keyChain;
-
-  ndn::Data data("/test");
-  keyChain.sign(data);
+  Data data("/test");
+  m_keyChain.sign(data);
 
   this->receive(data);
 
@@ -125,11 +123,11 @@
 
 BOOST_AUTO_TEST_CASE(CaptureNack)
 {
-  ndn::Interest interest("/test");
+  Interest interest("/test");
   interest.setNonce(0);
 
-  ndn::lp::Nack nack(interest);
-  nack.setReason(ndn::lp::NackReason::DUPLICATE);
+  lp::Nack nack(interest);
+  nack.setReason(lp::NackReason::DUPLICATE);
 
   lp::Packet lpPacket(interest.wireEncode());
   lpPacket.add<lp::NackField>(nack.getHeader());
@@ -149,7 +147,7 @@
         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
   };
 
-  ndn::Buffer buffer(data, 4);
+  Buffer buffer(data, 4);
 
   lp::Packet lpPacket;
   lpPacket.add<lp::FragmentField>(std::make_pair(buffer.begin(), buffer.end()));
@@ -201,7 +199,7 @@
 
 BOOST_AUTO_TEST_CASE(CaptureUnknownNetworkPacket)
 {
-  EncodingBuffer buffer(ndn::encoding::makeEmptyBlock(tlv::Name));
+  EncodingBuffer buffer(encoding::makeEmptyBlock(tlv::Name));
 
   this->receive(buffer);
 
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index 01754ba..171216f 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California.
+ * Copyright (c) 2014-2017,  Regents of the University of California.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -18,6 +18,10 @@
  */
 
 #include "identity-management-fixture.hpp"
+#include <ndn-cxx/security/pib/identity.hpp>
+#include <ndn-cxx/security/pib/key.hpp>
+#include <ndn-cxx/security/pib/pib.hpp>
+#include <ndn-cxx/security/v2/certificate.hpp>
 #include <ndn-cxx/util/io.hpp>
 #include <boost/filesystem.hpp>
 
@@ -25,21 +29,13 @@
 namespace tests {
 
 IdentityManagementFixture::IdentityManagementFixture()
-  : m_keyChainPath((boost::filesystem::path(TMP_TESTS_PATH) / "IdentityManagementFixture").string())
-  , m_keyChain("pib-sqlite3:" + m_keyChainPath, "tpm-file:" + m_keyChainPath)
+  : m_keyChain("pib-memory:", "tpm-memory:")
 {
 }
 
 IdentityManagementFixture::~IdentityManagementFixture()
 {
-  for (const auto& id : m_identities) {
-    m_keyChain.deleteIdentity(id);
-  }
-
-  boost::system::error_code ec; // ignore error
-
-  boost::filesystem::remove_all(m_keyChainPath, ec);
-
+  boost::system::error_code ec;
   for (const auto& certFile : m_certFiles) {
     boost::filesystem::remove(certFile, ec);
   }
@@ -50,7 +46,6 @@
 {
   try {
     m_keyChain.createIdentity(identity, params);
-    m_identities.push_back(identity);
     return true;
   }
   catch (const std::runtime_error&) {
@@ -61,11 +56,11 @@
 bool
 IdentityManagementFixture::saveIdentityCertificate(const Name& identity, const std::string& filename, bool wantAdd)
 {
-  shared_ptr<IdentityCertificate> cert;
+  security::v2::Certificate cert;
   try {
-    cert = m_keyChain.getCertificate(m_keyChain.getDefaultCertificateNameForIdentity(identity));
+    cert = m_keyChain.getPib().getIdentity(identity).getDefaultKey().getDefaultCertificate();
   }
-  catch (const SecPublicInfo::Error&) {
+  catch (const security::Pib::Error&) {
     if (wantAdd && this->addIdentity(identity)) {
       return this->saveIdentityCertificate(identity, filename, false);
     }
@@ -74,7 +69,7 @@
 
   m_certFiles.push_back(filename);
   try {
-    io::save(*cert, filename);
+    io::save(cert, filename);
     return true;
   }
   catch (const io::Error&) {
diff --git a/tests/identity-management-fixture.hpp b/tests/identity-management-fixture.hpp
index 2d84fae..fbe5251 100644
--- a/tests/identity-management-fixture.hpp
+++ b/tests/identity-management-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California.
+ * Copyright (c) 2014-2017,  Regents of the University of California.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -27,14 +27,14 @@
 namespace ndn {
 namespace tests {
 
-/** \brief a fixture that cleans up KeyChain identities and certificate files upon destruction
+/** \brief a fixture providing an in-memory KeyChain
  */
 class IdentityManagementFixture
 {
 public:
   IdentityManagementFixture();
 
-  /** \brief deletes created identities and saved certificate files
+  /** \brief deletes saved certificate files
    */
   ~IdentityManagementFixture();
 
@@ -42,7 +42,7 @@
    *  \return whether successful
    */
   bool
-  addIdentity(const Name& identity, const KeyParams& params = KeyChain::DEFAULT_KEY_PARAMS);
+  addIdentity(const Name& identity, const KeyParams& params = KeyChain::getDefaultKeyParams());
 
   /** \brief save identity certificate to a file
    *  \param identity identity name
@@ -53,14 +53,10 @@
   bool
   saveIdentityCertificate(const Name& identity, const std::string& filename, bool wantAdd = false);
 
-private:
-  std::string m_keyChainPath;
-
 protected:
   KeyChain m_keyChain;
 
 private:
-  std::vector<Name> m_identities;
   std::vector<std::string> m_certFiles;
 };
 
