security: Move PIB-related code into security/pib/

Change-Id: I94ea7ce646e66382f7c534ca1c8d6cbeeb87b1a4
diff --git a/src/security/certificate-container.cpp b/src/security/pib/certificate-container.cpp
similarity index 100%
rename from src/security/certificate-container.cpp
rename to src/security/pib/certificate-container.cpp
diff --git a/src/security/certificate-container.hpp b/src/security/pib/certificate-container.hpp
similarity index 91%
rename from src/security/certificate-container.hpp
rename to src/security/pib/certificate-container.hpp
index f0cc408..8e77e43 100644
--- a/src/security/certificate-container.hpp
+++ b/src/security/pib/certificate-container.hpp
@@ -19,11 +19,11 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_CERTIFICATE_CONTAINER_HPP
-#define NDN_SECURITY_CERTIFICATE_CONTAINER_HPP
+#ifndef NDN_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
+#define NDN_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
 
 #include <set>
-#include "v1/identity-certificate.hpp"
+#include "../v1/identity-certificate.hpp"
 
 namespace ndn {
 namespace security {
@@ -90,4 +90,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_CERTIFICATE_CONTAINER_HPP
+#endif // NDN_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
diff --git a/src/security/identity-container.cpp b/src/security/pib/identity-container.cpp
similarity index 97%
rename from src/security/identity-container.cpp
rename to src/security/pib/identity-container.cpp
index 756a75a..605be8b 100644
--- a/src/security/identity-container.cpp
+++ b/src/security/pib/identity-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
diff --git a/src/security/identity-container.hpp b/src/security/pib/identity-container.hpp
similarity index 90%
rename from src/security/identity-container.hpp
rename to src/security/pib/identity-container.hpp
index dee80dd..1de18c7 100644
--- a/src/security/identity-container.hpp
+++ b/src/security/pib/identity-container.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_IDENTITY_CONTAINER_HPP
-#define NDN_SECURITY_IDENTITY_CONTAINER_HPP
+#ifndef NDN_SECURITY_PIB_IDENTITY_CONTAINER_HPP
+#define NDN_SECURITY_PIB_IDENTITY_CONTAINER_HPP
 
 #include <set>
 #include "identity.hpp"
@@ -91,4 +91,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_IDENTITY_CONTAINER_HPP
+#endif // NDN_SECURITY_PIB_IDENTITY_CONTAINER_HPP
diff --git a/src/security/identity.cpp b/src/security/pib/identity.cpp
similarity index 100%
rename from src/security/identity.cpp
rename to src/security/pib/identity.cpp
diff --git a/src/security/identity.hpp b/src/security/pib/identity.hpp
similarity index 97%
rename from src/security/identity.hpp
rename to src/security/pib/identity.hpp
index 1e4bd2c..3c081ef 100644
--- a/src/security/identity.hpp
+++ b/src/security/pib/identity.hpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_IDENTITY_HPP
-#define NDN_SECURITY_IDENTITY_HPP
+#ifndef NDN_SECURITY_PIB_IDENTITY_HPP
+#define NDN_SECURITY_PIB_IDENTITY_HPP
 
 #include "key-container.hpp"
 
@@ -191,4 +191,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_IDENTITY_HPP
+#endif // NDN_SECURITY_PIB_IDENTITY_HPP
diff --git a/src/security/key-container.cpp b/src/security/pib/key-container.cpp
similarity index 97%
rename from src/security/key-container.cpp
rename to src/security/pib/key-container.cpp
index 51ffac5..ca30ab9 100644
--- a/src/security/key-container.cpp
+++ b/src/security/pib/key-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
diff --git a/src/security/key-container.hpp b/src/security/pib/key-container.hpp
similarity index 91%
rename from src/security/key-container.hpp
rename to src/security/pib/key-container.hpp
index 9799d03..7d88da9 100644
--- a/src/security/key-container.hpp
+++ b/src/security/pib/key-container.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_KEY_CONTAINER_HPP
-#define NDN_SECURITY_KEY_CONTAINER_HPP
+#ifndef NDN_SECURITY_PIB_KEY_CONTAINER_HPP
+#define NDN_SECURITY_PIB_KEY_CONTAINER_HPP
 
 #include <set>
 #include "key.hpp"
@@ -96,4 +96,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_KEY_CONTAINER_HPP
+#endif // NDN_SECURITY_PIB_KEY_CONTAINER_HPP
diff --git a/src/security/key.cpp b/src/security/pib/key.cpp
similarity index 100%
rename from src/security/key.cpp
rename to src/security/pib/key.cpp
diff --git a/src/security/key.hpp b/src/security/pib/key.hpp
similarity index 97%
rename from src/security/key.hpp
rename to src/security/pib/key.hpp
index a237a38..7118149 100644
--- a/src/security/key.hpp
+++ b/src/security/pib/key.hpp
@@ -19,10 +19,10 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_KEY_HPP
-#define NDN_SECURITY_KEY_HPP
+#ifndef NDN_SECURITY_PIB_KEY_HPP
+#define NDN_SECURITY_PIB_KEY_HPP
 
-#include "v1/identity-certificate.hpp"
+#include "../v1/identity-certificate.hpp"
 #include "certificate-container.hpp"
 
 namespace ndn {
@@ -204,4 +204,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_PIB_HPP
+#endif // NDN_SECURITY_PIB_PIB_HPP
diff --git a/src/security/pib-impl.hpp b/src/security/pib/pib-impl.hpp
similarity index 98%
rename from src/security/pib-impl.hpp
rename to src/security/pib/pib-impl.hpp
index d2b2324..7aa47a2 100644
--- a/src/security/pib-impl.hpp
+++ b/src/security/pib/pib-impl.hpp
@@ -19,11 +19,11 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_PIB_IMPL_HPP
-#define NDN_SECURITY_PIB_IMPL_HPP
+#ifndef NDN_SECURITY_PIB_PIB_IMPL_HPP
+#define NDN_SECURITY_PIB_PIB_IMPL_HPP
 
 #include <set>
-#include "v1/identity-certificate.hpp"
+#include "../v1/identity-certificate.hpp"
 
 namespace ndn {
 namespace security {
@@ -301,4 +301,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_PIB_IMPL_HPP
+#endif // NDN_SECURITY_PIB_PIB_IMPL_HPP
diff --git a/src/security/pib-memory.cpp b/src/security/pib/pib-memory.cpp
similarity index 100%
rename from src/security/pib-memory.cpp
rename to src/security/pib/pib-memory.cpp
diff --git a/src/security/pib-memory.hpp b/src/security/pib/pib-memory.hpp
similarity index 96%
rename from src/security/pib-memory.hpp
rename to src/security/pib/pib-memory.hpp
index 50da3dd..0cfe7c1 100644
--- a/src/security/pib-memory.hpp
+++ b/src/security/pib/pib-memory.hpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_PIB_MEMORY_HPP
-#define NDN_SECURITY_PIB_MEMORY_HPP
+#ifndef NDN_SECURITY_PIB_PIB_MEMORY_HPP
+#define NDN_SECURITY_PIB_PIB_MEMORY_HPP
 
 #include "pib-impl.hpp"
 
@@ -150,4 +150,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_PIB_MEMORY_HPP
+#endif // NDN_SECURITY_PIB_PIB_MEMORY_HPP
diff --git a/src/security/pib-sqlite3.cpp b/src/security/pib/pib-sqlite3.cpp
similarity index 100%
rename from src/security/pib-sqlite3.cpp
rename to src/security/pib/pib-sqlite3.cpp
diff --git a/src/security/pib-sqlite3.hpp b/src/security/pib/pib-sqlite3.hpp
similarity index 96%
rename from src/security/pib-sqlite3.hpp
rename to src/security/pib/pib-sqlite3.hpp
index 9093957..7e4b2c5 100644
--- a/src/security/pib-sqlite3.hpp
+++ b/src/security/pib/pib-sqlite3.hpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITTY_PIB_SQLITE3_HPP
-#define NDN_SECURITTY_PIB_SQLITE3_HPP
+#ifndef NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
+#define NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
 
 #include "pib-impl.hpp"
 
@@ -140,4 +140,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITTY_PIB_SQLITE3_HPP
+#endif // NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
diff --git a/src/security/pib.cpp b/src/security/pib/pib.cpp
similarity index 97%
rename from src/security/pib.cpp
rename to src/security/pib/pib.cpp
index df366c9..511c96a 100644
--- a/src/security/pib.cpp
+++ b/src/security/pib/pib.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
diff --git a/src/security/pib.hpp b/src/security/pib/pib.hpp
similarity index 96%
rename from src/security/pib.hpp
rename to src/security/pib/pib.hpp
index 1fd2006..5c5a11c 100644
--- a/src/security/pib.hpp
+++ b/src/security/pib/pib.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_SECURITY_PIB_HPP
-#define NDN_SECURITY_PIB_HPP
+#ifndef NDN_SECURITY_PIB_PIB_HPP
+#define NDN_SECURITY_PIB_PIB_HPP
 
 #include "identity-container.hpp"
 
@@ -184,4 +184,4 @@
 } // namespace security
 } // namespace ndn
 
-#endif // NDN_SECURITY_PIB_HPP
+#endif // NDN_SECURITY_PIB_PIB_HPP
diff --git a/tests/unit-tests/security/certificate-container.t.cpp b/tests/unit-tests/security/pib/certificate-container.t.cpp
similarity index 92%
rename from tests/unit-tests/security/certificate-container.t.cpp
rename to tests/unit-tests/security/pib/certificate-container.t.cpp
index 6ff8499..514cc3d 100644
--- a/tests/unit-tests/security/certificate-container.t.cpp
+++ b/tests/unit-tests/security/pib/certificate-container.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/certificate-container.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/certificate-container.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestCertificateContainer)
 
 BOOST_FIXTURE_TEST_CASE(TestCertificateContainer, PibDataFixture)
@@ -73,6 +74,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestCertificateContainer
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/identity-container.t.cpp b/tests/unit-tests/security/pib/identity-container.t.cpp
similarity index 92%
rename from tests/unit-tests/security/identity-container.t.cpp
rename to tests/unit-tests/security/pib/identity-container.t.cpp
index c2c1c0e..4cf57e9 100644
--- a/tests/unit-tests/security/identity-container.t.cpp
+++ b/tests/unit-tests/security/pib/identity-container.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/identity-container.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/identity-container.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestIdentityContainer)
 
 BOOST_FIXTURE_TEST_CASE(Basic, PibDataFixture)
@@ -71,6 +72,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestIdentityContainer
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/identity.t.cpp b/tests/unit-tests/security/pib/identity.t.cpp
similarity index 93%
rename from tests/unit-tests/security/identity.t.cpp
rename to tests/unit-tests/security/pib/identity.t.cpp
index 5e04d4c..d31f7c6 100644
--- a/tests/unit-tests/security/identity.t.cpp
+++ b/tests/unit-tests/security/pib/identity.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/identity.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/identity.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_FIXTURE_TEST_SUITE(TestIdentity, PibDataFixture)
 
 BOOST_AUTO_TEST_CASE(ValidityChecking)
@@ -81,6 +82,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestIdentity
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/key-container.t.cpp b/tests/unit-tests/security/pib/key-container.t.cpp
similarity index 93%
rename from tests/unit-tests/security/key-container.t.cpp
rename to tests/unit-tests/security/pib/key-container.t.cpp
index 817a84f..ee5bf1c 100644
--- a/tests/unit-tests/security/key-container.t.cpp
+++ b/tests/unit-tests/security/pib/key-container.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/key-container.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/key-container.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestKeyContainer)
 
 BOOST_FIXTURE_TEST_CASE(Basic, PibDataFixture)
@@ -74,6 +75,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestKeyContainer
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/key.t.cpp b/tests/unit-tests/security/pib/key.t.cpp
similarity index 94%
rename from tests/unit-tests/security/key.t.cpp
rename to tests/unit-tests/security/pib/key.t.cpp
index 7d9ddc1..673c149 100644
--- a/tests/unit-tests/security/key.t.cpp
+++ b/tests/unit-tests/security/pib/key.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/key.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/key.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_FIXTURE_TEST_SUITE(TestKey, PibDataFixture)
 
 BOOST_AUTO_TEST_CASE(ValidityChecking)
@@ -87,6 +88,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestKey
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib-data-fixture.cpp b/tests/unit-tests/security/pib/pib-data-fixture.cpp
similarity index 99%
rename from tests/unit-tests/security/pib-data-fixture.cpp
rename to tests/unit-tests/security/pib/pib-data-fixture.cpp
index 18b2cfb..25eb83c 100644
--- a/tests/unit-tests/security/pib-data-fixture.cpp
+++ b/tests/unit-tests/security/pib/pib-data-fixture.cpp
@@ -20,6 +20,11 @@
  */
 
 #include "pib-data-fixture.hpp"
+#include "../../identity-management-time-fixture.hpp"
+
+namespace ndn {
+namespace security {
+namespace tests {
 
 /**
  * The test data can be generated with a TestCertDataGenerator defined as below:
@@ -311,9 +316,6 @@
   0x2C, 0x3D, 0x86, 0xCF, 0xF6, 0x8D, 0x2F, 0x13, 0x60, 0x28, 0xB1, 0x13, 0xFE, 0x49, 0x3B, 0xA4, 0xAD
 };
 
-namespace ndn {
-namespace security {
-
 PibDataFixture::PibDataFixture()
   : id1("/pib/interface/id/1")
   , id2("/pib/interface/id/2")
@@ -336,5 +338,6 @@
 {
 }
 
+} // namespace tests
 } // namespace security
 } // namespace ndn
diff --git a/tests/unit-tests/security/pib-data-fixture.hpp b/tests/unit-tests/security/pib/pib-data-fixture.hpp
similarity index 97%
rename from tests/unit-tests/security/pib-data-fixture.hpp
rename to tests/unit-tests/security/pib/pib-data-fixture.hpp
index 5e92dd1..2971cd5 100644
--- a/tests/unit-tests/security/pib-data-fixture.hpp
+++ b/tests/unit-tests/security/pib/pib-data-fixture.hpp
@@ -28,6 +28,7 @@
 
 namespace ndn {
 namespace security {
+namespace tests {
 
 class PibDataFixture
 {
@@ -58,6 +59,7 @@
   v1::IdentityCertificate id2Key2Cert2;
 };
 
+} // namespace tests
 } // namespace security
 } // namespace ndn
 
diff --git a/tests/unit-tests/security/pib-impl.t.cpp b/tests/unit-tests/security/pib/pib-impl.t.cpp
similarity index 97%
rename from tests/unit-tests/security/pib-impl.t.cpp
rename to tests/unit-tests/security/pib/pib-impl.t.cpp
index d86a95d..9a0e85f 100644
--- a/tests/unit-tests/security/pib-impl.t.cpp
+++ b/tests/unit-tests/security/pib/pib-impl.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib-memory.hpp"
-#include "security/pib-sqlite3.hpp"
-#include "security/pib.hpp"
+#include "security/pib/pib-memory.hpp"
+#include "security/pib/pib-sqlite3.hpp"
+#include "security/pib/pib.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -34,6 +34,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestPibImpl)
 
 class PibMemoryWrapper
@@ -227,6 +228,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibImpl
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib-memory.t.cpp b/tests/unit-tests/security/pib/pib-memory.t.cpp
similarity index 93%
rename from tests/unit-tests/security/pib-memory.t.cpp
rename to tests/unit-tests/security/pib/pib-memory.t.cpp
index 74dde3f..9d2c3f8 100644
--- a/tests/unit-tests/security/pib-memory.t.cpp
+++ b/tests/unit-tests/security/pib/pib-memory.t.cpp
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib-memory.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 
@@ -27,10 +27,10 @@
 namespace security {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(TestPibMemory)
-
 // most functionalities are tested in pib-impl.t.cpp
+BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
+BOOST_AUTO_TEST_SUITE(TestPibMemory)
 
 BOOST_AUTO_TEST_CASE(TpmLocatorManagement)
 {
@@ -41,6 +41,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibMemory
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib-sqlite3.t.cpp b/tests/unit-tests/security/pib/pib-sqlite3.t.cpp
similarity index 97%
rename from tests/unit-tests/security/pib-sqlite3.t.cpp
rename to tests/unit-tests/security/pib/pib-sqlite3.t.cpp
index 656900e..7055a37 100644
--- a/tests/unit-tests/security/pib-sqlite3.t.cpp
+++ b/tests/unit-tests/security/pib/pib-sqlite3.t.cpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib-sqlite3.hpp"
-#include "security/pib.hpp"
+#include "security/pib/pib-sqlite3.hpp"
+#include "security/pib/pib.hpp"
 
 #include "boost-test.hpp"
 
@@ -30,6 +30,9 @@
 namespace security {
 namespace tests {
 
+BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
+
 class PibSqlite3TestFixture
 {
 public:
@@ -51,7 +54,6 @@
   PibSqlite3 impl;
 };
 
-BOOST_AUTO_TEST_SUITE(Security)
 BOOST_FIXTURE_TEST_SUITE(TestPibSqlite3, PibSqlite3TestFixture)
 
 // most functionalities are tested in pib-impl.t.cpp
@@ -119,6 +121,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibSqlite3
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib.t.cpp b/tests/unit-tests/security/pib/pib.t.cpp
similarity index 92%
rename from tests/unit-tests/security/pib.t.cpp
rename to tests/unit-tests/security/pib/pib.t.cpp
index be617ac..7c6b47f 100644
--- a/tests/unit-tests/security/pib.t.cpp
+++ b/tests/unit-tests/security/pib/pib.t.cpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -30,7 +30,8 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestPib, PibDataFixture)
+BOOST_AUTO_TEST_SUITE(TestPib)
+BOOST_FIXTURE_TEST_SUITE(Common, PibDataFixture)
 
 BOOST_AUTO_TEST_CASE(ValidityChecking)
 {
@@ -79,6 +80,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() // Security