security: consolidate creation of identities/keys in the respective containers

Change-Id: I754e5711fd95b97834dd2e9c0ab1830eaff4be35
diff --git a/tests/unit/security/pib/key.t.cpp b/tests/unit/security/pib/key.t.cpp
index 2aa28e1..8265f01 100644
--- a/tests/unit/security/pib/key.t.cpp
+++ b/tests/unit/security/pib/key.t.cpp
@@ -21,8 +21,6 @@
 
 #include "ndn-cxx/security/pib/key.hpp"
 #include "ndn-cxx/security/pib/impl/key-impl.hpp"
-#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
-#include "ndn-cxx/security/pib/pib.hpp"
 
 #include "tests/boost-test.hpp"
 #include "tests/unit/security/pib/pib-data-fixture.hpp"
@@ -32,8 +30,6 @@
 namespace pib {
 namespace tests {
 
-using namespace ndn::security::tests;
-
 BOOST_AUTO_TEST_SUITE(Security)
 BOOST_AUTO_TEST_SUITE(Pib)
 BOOST_FIXTURE_TEST_SUITE(TestKey, PibDataFixture)
@@ -44,7 +40,8 @@
   BOOST_TEST(!key);
   BOOST_TEST(key == Key());
 
-  auto impl = std::make_shared<detail::KeyImpl>(id1Key1Name, id1Key1, std::make_shared<pib::PibMemory>());
+  auto impl = std::make_shared<detail::KeyImpl>(id1Key1Name, id1Key1,
+                                                makePibWithKey(id1Key1Name, id1Key1));
   key = Key(impl);
   BOOST_TEST(key);
   BOOST_TEST(key != Key());
@@ -59,7 +56,7 @@
 BOOST_AUTO_TEST_CASE(SharedImpl)
 {
   auto keyImpl = std::make_shared<detail::KeyImpl>(id1Key1Name, id1Key1,
-                                                   std::make_shared<pib::PibMemory>());
+                                                   makePibWithKey(id1Key1Name, id1Key1));
   Key key1(keyImpl);
   Key key2(keyImpl);