security: stop installing headers of concrete PIB, TPM, and KeyHandle implementations
Refs: #4782
Change-Id: I23bb75c485034140f29b10bd3a103f4aa480be4b
diff --git a/ndn-cxx/security/pib/pib-memory.cpp b/ndn-cxx/security/pib/impl/pib-memory.cpp
similarity index 98%
rename from ndn-cxx/security/pib/pib-memory.cpp
rename to ndn-cxx/security/pib/impl/pib-memory.cpp
index 5e365cc..c509851 100644
--- a/ndn-cxx/security/pib/pib-memory.cpp
+++ b/ndn-cxx/security/pib/impl/pib-memory.cpp
@@ -19,7 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/pib/pib-memory.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
#include "ndn-cxx/security/pib/pib.hpp"
#include "ndn-cxx/security/security-common.hpp"
diff --git a/ndn-cxx/security/pib/pib-memory.hpp b/ndn-cxx/security/pib/impl/pib-memory.hpp
similarity index 94%
rename from ndn-cxx/security/pib/pib-memory.hpp
rename to ndn-cxx/security/pib/impl/pib-memory.hpp
index a6f08db..df3cb7a 100644
--- a/ndn-cxx/security/pib/pib-memory.hpp
+++ b/ndn-cxx/security/pib/impl/pib-memory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 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_PIB_MEMORY_HPP
-#define NDN_SECURITY_PIB_PIB_MEMORY_HPP
+#ifndef NDN_SECURITY_PIB_IMPL_PIB_MEMORY_HPP
+#define NDN_SECURITY_PIB_IMPL_PIB_MEMORY_HPP
#include "ndn-cxx/security/pib/pib-impl.hpp"
@@ -145,4 +145,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITY_PIB_PIB_MEMORY_HPP
+#endif // NDN_SECURITY_PIB_IMPL_PIB_MEMORY_HPP
diff --git a/ndn-cxx/security/pib/pib-sqlite3.cpp b/ndn-cxx/security/pib/impl/pib-sqlite3.cpp
similarity index 99%
rename from ndn-cxx/security/pib/pib-sqlite3.cpp
rename to ndn-cxx/security/pib/impl/pib-sqlite3.cpp
index e460c2e..ca73641 100644
--- a/ndn-cxx/security/pib/pib-sqlite3.cpp
+++ b/ndn-cxx/security/pib/impl/pib-sqlite3.cpp
@@ -19,14 +19,15 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
+#include "ndn-cxx/security/pib/impl/pib-sqlite3.hpp"
#include "ndn-cxx/security/pib/pib.hpp"
#include "ndn-cxx/security/security-common.hpp"
#include "ndn-cxx/util/sqlite3-statement.hpp"
#include <sqlite3.h>
-#include <boost/filesystem.hpp>
+
#include <boost/algorithm/string.hpp>
+#include <boost/filesystem.hpp>
namespace ndn {
namespace security {
diff --git a/ndn-cxx/security/pib/pib-sqlite3.hpp b/ndn-cxx/security/pib/impl/pib-sqlite3.hpp
similarity index 94%
rename from ndn-cxx/security/pib/pib-sqlite3.hpp
rename to ndn-cxx/security/pib/impl/pib-sqlite3.hpp
index 4e7f60b..ab80add 100644
--- a/ndn-cxx/security/pib/pib-sqlite3.hpp
+++ b/ndn-cxx/security/pib/impl/pib-sqlite3.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 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_SECURITTY_PIB_PIB_SQLITE3_HPP
-#define NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
+#ifndef NDN_SECURITTY_PIB_IMPL_PIB_SQLITE3_HPP
+#define NDN_SECURITTY_PIB_IMPL_PIB_SQLITE3_HPP
#include "ndn-cxx/security/pib/pib-impl.hpp"
@@ -154,4 +154,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
+#endif // NDN_SECURITTY_PIB_IMPL_PIB_SQLITE3_HPP
diff --git a/ndn-cxx/security/tpm/back-end-file.cpp b/ndn-cxx/security/tpm/impl/back-end-file.cpp
similarity index 97%
rename from ndn-cxx/security/tpm/back-end-file.cpp
rename to ndn-cxx/security/tpm/impl/back-end-file.cpp
index 69cc810..58e9aaf 100644
--- a/ndn-cxx/security/tpm/back-end-file.cpp
+++ b/ndn-cxx/security/tpm/impl/back-end-file.cpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/tpm/back-end-file.hpp"
-#include "ndn-cxx/security/tpm/key-handle-mem.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-file.hpp"
+#include "ndn-cxx/security/tpm/impl/key-handle-mem.hpp"
#include "ndn-cxx/security/transform.hpp"
#include "ndn-cxx/security/transform/private-key.hpp"
#include "ndn-cxx/encoding/buffer-stream.hpp"
diff --git a/ndn-cxx/security/tpm/back-end-file.hpp b/ndn-cxx/security/tpm/impl/back-end-file.hpp
similarity index 94%
rename from ndn-cxx/security/tpm/back-end-file.hpp
rename to ndn-cxx/security/tpm/impl/back-end-file.hpp
index 97c1935..2f956fe 100644
--- a/ndn-cxx/security/tpm/back-end-file.hpp
+++ b/ndn-cxx/security/tpm/impl/back-end-file.hpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_SECURITY_TPM_BACK_END_FILE_HPP
-#define NDN_SECURITY_TPM_BACK_END_FILE_HPP
+#ifndef NDN_SECURITY_TPM_IMPL_BACK_END_FILE_HPP
+#define NDN_SECURITY_TPM_IMPL_BACK_END_FILE_HPP
#include "ndn-cxx/security/tpm/back-end.hpp"
@@ -99,4 +99,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITY_TPM_BACK_END_FILE_HPP
+#endif // NDN_SECURITY_TPM_IMPL_BACK_END_FILE_HPP
diff --git a/ndn-cxx/security/tpm/back-end-mem.cpp b/ndn-cxx/security/tpm/impl/back-end-mem.cpp
similarity index 96%
rename from ndn-cxx/security/tpm/back-end-mem.cpp
rename to ndn-cxx/security/tpm/impl/back-end-mem.cpp
index 89a29b8..dae98db 100644
--- a/ndn-cxx/security/tpm/back-end-mem.cpp
+++ b/ndn-cxx/security/tpm/impl/back-end-mem.cpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/tpm/back-end-mem.hpp"
-#include "ndn-cxx/security/tpm/key-handle-mem.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-mem.hpp"
+#include "ndn-cxx/security/tpm/impl/key-handle-mem.hpp"
#include "ndn-cxx/security/transform/private-key.hpp"
#include "ndn-cxx/encoding/buffer-stream.hpp"
diff --git a/ndn-cxx/security/tpm/back-end-mem.hpp b/ndn-cxx/security/tpm/impl/back-end-mem.hpp
similarity index 93%
rename from ndn-cxx/security/tpm/back-end-mem.hpp
rename to ndn-cxx/security/tpm/impl/back-end-mem.hpp
index eb96090..b185ba3 100644
--- a/ndn-cxx/security/tpm/back-end-mem.hpp
+++ b/ndn-cxx/security/tpm/impl/back-end-mem.hpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_SECURITY_TPM_BACK_END_MEM_HPP
-#define NDN_SECURITY_TPM_BACK_END_MEM_HPP
+#ifndef NDN_SECURITY_TPM_IMPL_BACK_END_MEM_HPP
+#define NDN_SECURITY_TPM_IMPL_BACK_END_MEM_HPP
#include "ndn-cxx/security/tpm/back-end.hpp"
@@ -78,4 +78,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITY_TPM_BACK_END_MEM_HPP
+#endif // NDN_SECURITY_TPM_IMPL_BACK_END_MEM_HPP
diff --git a/ndn-cxx/security/tpm/back-end-osx.cpp b/ndn-cxx/security/tpm/impl/back-end-osx.cpp
similarity index 98%
rename from ndn-cxx/security/tpm/back-end-osx.cpp
rename to ndn-cxx/security/tpm/impl/back-end-osx.cpp
index e41dfb4..85e0594 100644
--- a/ndn-cxx/security/tpm/back-end-osx.cpp
+++ b/ndn-cxx/security/tpm/impl/back-end-osx.cpp
@@ -19,9 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/tpm/back-end-osx.hpp"
-#include "ndn-cxx/security/tpm/key-handle-osx.hpp"
-#include "ndn-cxx/security/tpm/tpm.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/key-handle-osx.hpp"
#include "ndn-cxx/security/transform/private-key.hpp"
#include "ndn-cxx/detail/cf-string-osx.hpp"
#include "ndn-cxx/encoding/buffer-stream.hpp"
diff --git a/ndn-cxx/security/tpm/back-end-osx.hpp b/ndn-cxx/security/tpm/impl/back-end-osx.hpp
similarity index 93%
rename from ndn-cxx/security/tpm/back-end-osx.hpp
rename to ndn-cxx/security/tpm/impl/back-end-osx.hpp
index 611ae97..18df66a 100644
--- a/ndn-cxx/security/tpm/back-end-osx.hpp
+++ b/ndn-cxx/security/tpm/impl/back-end-osx.hpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_SECURITY_TPM_BACK_END_OSX_HPP
-#define NDN_SECURITY_TPM_BACK_END_OSX_HPP
+#ifndef NDN_SECURITY_TPM_IMPL_BACK_END_OSX_HPP
+#define NDN_SECURITY_TPM_IMPL_BACK_END_OSX_HPP
#include "ndn-cxx/security/tpm/back-end.hpp"
@@ -28,7 +28,7 @@
#error "This file should not be compiled ..."
#endif
-#include "ndn-cxx/security/tpm/key-ref-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/key-ref-osx.hpp"
namespace ndn {
namespace security {
@@ -110,4 +110,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITY_TPM_BACK_END_OSX_HPP
+#endif // NDN_SECURITY_TPM_IMPL_BACK_END_OSX_HPP
diff --git a/ndn-cxx/security/tpm/key-handle-mem.cpp b/ndn-cxx/security/tpm/impl/key-handle-mem.cpp
similarity index 97%
rename from ndn-cxx/security/tpm/key-handle-mem.cpp
rename to ndn-cxx/security/tpm/impl/key-handle-mem.cpp
index a3f24ba..99275e8 100644
--- a/ndn-cxx/security/tpm/key-handle-mem.cpp
+++ b/ndn-cxx/security/tpm/impl/key-handle-mem.cpp
@@ -19,7 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/tpm/key-handle-mem.hpp"
+#include "ndn-cxx/security/tpm/impl/key-handle-mem.hpp"
#include "ndn-cxx/security/transform/bool-sink.hpp"
#include "ndn-cxx/security/transform/buffer-source.hpp"
#include "ndn-cxx/security/transform/private-key.hpp"
diff --git a/ndn-cxx/security/tpm/key-handle-mem.hpp b/ndn-cxx/security/tpm/impl/key-handle-mem.hpp
similarity index 92%
rename from ndn-cxx/security/tpm/key-handle-mem.hpp
rename to ndn-cxx/security/tpm/impl/key-handle-mem.hpp
index 0417ebe..5ed9dff 100644
--- a/ndn-cxx/security/tpm/key-handle-mem.hpp
+++ b/ndn-cxx/security/tpm/impl/key-handle-mem.hpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_SECURITY_TPM_KEY_HANDLE_MEM_HPP
-#define NDN_SECURITY_TPM_KEY_HANDLE_MEM_HPP
+#ifndef NDN_SECURITY_TPM_IMPL_KEY_HANDLE_MEM_HPP
+#define NDN_SECURITY_TPM_IMPL_KEY_HANDLE_MEM_HPP
#include "ndn-cxx/security/tpm/key-handle.hpp"
@@ -64,4 +64,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITY_TPM_KEY_HANDLE_MEM_HPP
+#endif // NDN_SECURITY_TPM_IMPL_KEY_HANDLE_MEM_HPP
diff --git a/ndn-cxx/security/tpm/key-handle-osx.cpp b/ndn-cxx/security/tpm/impl/key-handle-osx.cpp
similarity index 94%
rename from ndn-cxx/security/tpm/key-handle-osx.cpp
rename to ndn-cxx/security/tpm/impl/key-handle-osx.cpp
index db45896..0ff3d54 100644
--- a/ndn-cxx/security/tpm/key-handle-osx.cpp
+++ b/ndn-cxx/security/tpm/impl/key-handle-osx.cpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/tpm/key-handle-osx.hpp"
-#include "ndn-cxx/security/tpm/back-end-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/key-handle-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
namespace ndn {
namespace security {
diff --git a/ndn-cxx/security/tpm/key-handle-osx.hpp b/ndn-cxx/security/tpm/impl/key-handle-osx.hpp
similarity index 90%
rename from ndn-cxx/security/tpm/key-handle-osx.hpp
rename to ndn-cxx/security/tpm/impl/key-handle-osx.hpp
index 87a8c56..bb65944 100644
--- a/ndn-cxx/security/tpm/key-handle-osx.hpp
+++ b/ndn-cxx/security/tpm/impl/key-handle-osx.hpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
-#define NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
+#ifndef NDN_SECURITY_TPM_IMPL_KEY_HANDLE_OSX_HPP
+#define NDN_SECURITY_TPM_IMPL_KEY_HANDLE_OSX_HPP
#include "ndn-cxx/security/tpm/key-handle.hpp"
@@ -28,7 +28,7 @@
#error "This file should not be compiled ..."
#endif
-#include "ndn-cxx/security/tpm/key-ref-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/key-ref-osx.hpp"
namespace ndn {
namespace security {
@@ -65,4 +65,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
+#endif // NDN_SECURITY_TPM_IMPL_KEY_HANDLE_OSX_HPP
diff --git a/ndn-cxx/security/tpm/key-ref-osx.hpp b/ndn-cxx/security/tpm/impl/key-ref-osx.hpp
similarity index 86%
rename from ndn-cxx/security/tpm/key-ref-osx.hpp
rename to ndn-cxx/security/tpm/impl/key-ref-osx.hpp
index bd17103..9833387 100644
--- a/ndn-cxx/security/tpm/key-ref-osx.hpp
+++ b/ndn-cxx/security/tpm/impl/key-ref-osx.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 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_TPM_KEY_REF_OSX_HPP
-#define NDN_SECURITY_TPM_KEY_REF_OSX_HPP
+#ifndef NDN_SECURITY_TPM_IMPL_KEY_REF_OSX_HPP
+#define NDN_SECURITY_TPM_IMPL_KEY_REF_OSX_HPP
#include "ndn-cxx/detail/common.hpp"
@@ -42,4 +42,4 @@
} // namespace security
} // namespace ndn
-#endif // NDN_SECURITY_TPM_KEY_REF_OSX_HPP
+#endif // NDN_SECURITY_TPM_IMPL_KEY_REF_OSX_HPP
diff --git a/ndn-cxx/security/v2/key-chain.cpp b/ndn-cxx/security/v2/key-chain.cpp
index dfac81b..63f1d98 100644
--- a/ndn-cxx/security/v2/key-chain.cpp
+++ b/ndn-cxx/security/v2/key-chain.cpp
@@ -26,13 +26,13 @@
#include "ndn-cxx/util/logger.hpp"
#include "ndn-cxx/util/sha256.hpp"
-#include "ndn-cxx/security/pib/pib-memory.hpp"
-#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
+#include "ndn-cxx/security/pib/impl/pib-sqlite3.hpp"
-#include "ndn-cxx/security/tpm/back-end-file.hpp"
-#include "ndn-cxx/security/tpm/back-end-mem.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-file.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-mem.hpp"
#ifdef NDN_CXX_HAVE_OSX_FRAMEWORKS
-#include "ndn-cxx/security/tpm/back-end-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
#endif // NDN_CXX_HAVE_OSX_FRAMEWORKS
#include "ndn-cxx/security/transform/bool-sink.hpp"
@@ -59,7 +59,6 @@
#if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS) && defined(NDN_CXX_WITH_OSX_KEYCHAIN)
NDN_CXX_V2_KEYCHAIN_REGISTER_TPM_BACKEND(BackEndOsx);
#endif // defined(NDN_CXX_HAVE_OSX_FRAMEWORKS) && defined(NDN_CXX_WITH_OSX_KEYCHAIN)
-
NDN_CXX_V2_KEYCHAIN_REGISTER_TPM_BACKEND(BackEndFile);
NDN_CXX_V2_KEYCHAIN_REGISTER_TPM_BACKEND(BackEndMem);
} // namespace tpm
diff --git a/tests/unit/security/pib/certificate-container.t.cpp b/tests/unit/security/pib/certificate-container.t.cpp
index f34c0fe..b6e9f12 100644
--- a/tests/unit/security/pib/certificate-container.t.cpp
+++ b/tests/unit/security/pib/certificate-container.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,8 +20,8 @@
*/
#include "ndn-cxx/security/pib/certificate-container.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
#include "ndn-cxx/security/pib/pib.hpp"
-#include "ndn-cxx/security/pib/pib-memory.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
diff --git a/tests/unit/security/pib/identity-container.t.cpp b/tests/unit/security/pib/identity-container.t.cpp
index fbce528..fb5e9cc 100644
--- a/tests/unit/security/pib/identity-container.t.cpp
+++ b/tests/unit/security/pib/identity-container.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,8 +20,8 @@
*/
#include "ndn-cxx/security/pib/identity-container.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
#include "ndn-cxx/security/pib/pib.hpp"
-#include "ndn-cxx/security/pib/pib-memory.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
diff --git a/tests/unit/security/pib/identity.t.cpp b/tests/unit/security/pib/identity.t.cpp
index 5769fde..4d79bbc 100644
--- a/tests/unit/security/pib/identity.t.cpp
+++ b/tests/unit/security/pib/identity.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,9 +20,9 @@
*/
#include "ndn-cxx/security/pib/identity.hpp"
-#include "ndn-cxx/security/pib/pib.hpp"
-#include "ndn-cxx/security/pib/pib-memory.hpp"
#include "ndn-cxx/security/pib/impl/identity-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"
@@ -38,44 +38,24 @@
BOOST_AUTO_TEST_SUITE(Pib)
BOOST_FIXTURE_TEST_SUITE(TestIdentity, PibDataFixture)
-using pib::Pib;
-
BOOST_AUTO_TEST_CASE(ValidityChecking)
{
- using security::pib::detail::IdentityImpl;
-
Identity id;
-
+ BOOST_CHECK(!id);
BOOST_CHECK_EQUAL(static_cast<bool>(id), false);
- BOOST_CHECK_EQUAL(!id, true);
- if (id)
- BOOST_CHECK(false);
- else
- BOOST_CHECK(true);
-
- auto identityImpl = make_shared<IdentityImpl>(id1, make_shared<PibMemory>(), true);
+ auto identityImpl = make_shared<detail::IdentityImpl>(id1, make_shared<PibMemory>(), true);
id = Identity(identityImpl);
-
- BOOST_CHECK_EQUAL(static_cast<bool>(id), true);
+ BOOST_CHECK(id);
BOOST_CHECK_EQUAL(!id, false);
-
- if (id)
- BOOST_CHECK(true);
- else
- BOOST_CHECK(false);
}
-/**
- * pib::Identity is a wrapper of pib::detail::IdentityImpl. Since the functionalities of
- * IdentityImpl have already been tested in detail/identity-impl.t.cpp, we only test the shared
- * property of pib::Identity in this test case.
- */
-BOOST_AUTO_TEST_CASE(Share)
+// pib::Identity is a wrapper of pib::detail::IdentityImpl. Since the functionalities of
+// IdentityImpl have already been tested in detail/identity-impl.t.cpp, we only test the shared
+// property of pib::Identity in this test case.
+BOOST_AUTO_TEST_CASE(SharedImpl)
{
- using security::pib::detail::IdentityImpl;
-
- auto identityImpl = make_shared<IdentityImpl>(id1, make_shared<pib::PibMemory>(), true);
+ auto identityImpl = make_shared<detail::IdentityImpl>(id1, make_shared<pib::PibMemory>(), true);
Identity identity1(identityImpl);
Identity identity2(identityImpl);
BOOST_CHECK_EQUAL(identity1, identity2);
@@ -85,7 +65,7 @@
identity1.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
BOOST_CHECK_NO_THROW(identity2.getKey(id1Key1Name));
identity2.removeKey(id1Key1Name);
- BOOST_CHECK_THROW(identity1.getKey(id1Key1Name), Pib::Error);
+ BOOST_CHECK_THROW(identity1.getKey(id1Key1Name), pib::Pib::Error);
identity1.setDefaultKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
BOOST_CHECK_NO_THROW(identity2.getDefaultKey());
diff --git a/tests/unit/security/pib/impl/identity-impl.t.cpp b/tests/unit/security/pib/impl/identity-impl.t.cpp
index 40bf424..bb523f4 100644
--- a/tests/unit/security/pib/impl/identity-impl.t.cpp
+++ b/tests/unit/security/pib/impl/identity-impl.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,8 +20,8 @@
*/
#include "ndn-cxx/security/pib/impl/identity-impl.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
#include "ndn-cxx/security/pib/pib.hpp"
-#include "ndn-cxx/security/pib/pib-memory.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
diff --git a/tests/unit/security/pib/impl/key-impl.t.cpp b/tests/unit/security/pib/impl/key-impl.t.cpp
index e6860be..2a6c641 100644
--- a/tests/unit/security/pib/impl/key-impl.t.cpp
+++ b/tests/unit/security/pib/impl/key-impl.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,8 +20,8 @@
*/
#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 "ndn-cxx/security/pib/pib-memory.hpp"
#include "tests/boost-test.hpp"
#include "tests/identity-management-fixture.hpp"
diff --git a/tests/unit/security/pib/key-container.t.cpp b/tests/unit/security/pib/key-container.t.cpp
index ce5b6ab..aab7b1c 100644
--- a/tests/unit/security/pib/key-container.t.cpp
+++ b/tests/unit/security/pib/key-container.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,8 +20,8 @@
*/
#include "ndn-cxx/security/pib/key-container.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
#include "ndn-cxx/security/pib/pib.hpp"
-#include "ndn-cxx/security/pib/pib-memory.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
diff --git a/tests/unit/security/pib/key.t.cpp b/tests/unit/security/pib/key.t.cpp
index 8dfe9c8..f5c62fa 100644
--- a/tests/unit/security/pib/key.t.cpp
+++ b/tests/unit/security/pib/key.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,9 +20,9 @@
*/
#include "ndn-cxx/security/pib/key.hpp"
-#include "ndn-cxx/security/pib/pib.hpp"
-#include "ndn-cxx/security/pib/pib-memory.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"
@@ -38,47 +38,26 @@
BOOST_AUTO_TEST_SUITE(Pib)
BOOST_FIXTURE_TEST_SUITE(TestKey, PibDataFixture)
-using pib::Pib;
-
BOOST_AUTO_TEST_CASE(ValidityChecking)
{
- using security::pib::detail::KeyImpl;
-
Key key;
-
+ BOOST_CHECK(!key);
BOOST_CHECK_EQUAL(static_cast<bool>(key), false);
- BOOST_CHECK_EQUAL(!key, true);
- if (key)
- BOOST_CHECK(false);
- else
- BOOST_CHECK(true);
-
- auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
- make_shared<pib::PibMemory>());
+ auto keyImpl = make_shared<detail::KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
+ make_shared<pib::PibMemory>());
key = Key(keyImpl);
-
- BOOST_CHECK_EQUAL(static_cast<bool>(key), true);
+ BOOST_CHECK(key);
BOOST_CHECK_EQUAL(!key, false);
-
- if (key)
- BOOST_CHECK(true);
- else
- BOOST_CHECK(false);
}
-/**
- * pib::Key is a wrapper of pib::detail::KeyImpl. Since the functionalities of KeyImpl
- * have already been tested in detail/key-impl.t.cpp, we only test the shared property
- * of pib::Key in this test case.
- */
-
-BOOST_AUTO_TEST_CASE(Share)
+// pib::Key is a wrapper of pib::detail::KeyImpl. Since the functionalities of KeyImpl
+// have already been tested in detail/key-impl.t.cpp, we only test the shared property
+// of pib::Key in this test case.
+BOOST_AUTO_TEST_CASE(SharedImpl)
{
- using security::pib::detail::KeyImpl;
-
- auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
- make_shared<pib::PibMemory>());
+ auto keyImpl = make_shared<detail::KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
+ make_shared<pib::PibMemory>());
Key key1(keyImpl);
Key key2(keyImpl);
BOOST_CHECK_EQUAL(key1, key2);
@@ -88,7 +67,7 @@
key1.addCertificate(id1Key1Cert1);
BOOST_CHECK_NO_THROW(key2.getCertificate(id1Key1Cert1.getName()));
key2.removeCertificate(id1Key1Cert1.getName());
- BOOST_CHECK_THROW(key1.getCertificate(id1Key1Cert1.getName()), Pib::Error);
+ BOOST_CHECK_THROW(key1.getCertificate(id1Key1Cert1.getName()), pib::Pib::Error);
key1.setDefaultCertificate(id1Key1Cert1);
BOOST_CHECK_NO_THROW(key2.getDefaultCertificate());
diff --git a/tests/unit/security/pib/pib-impl.t.cpp b/tests/unit/security/pib/pib-impl.t.cpp
index 2cbdc2f..500e5fd 100644
--- a/tests/unit/security/pib/pib-impl.t.cpp
+++ b/tests/unit/security/pib/pib-impl.t.cpp
@@ -19,8 +19,8 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/pib/pib-memory.hpp"
-#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
+#include "ndn-cxx/security/pib/impl/pib-sqlite3.hpp"
#include "ndn-cxx/security/pib/pib.hpp"
#include "ndn-cxx/security/security-common.hpp"
diff --git a/tests/unit/security/pib/pib-memory.t.cpp b/tests/unit/security/pib/pib-memory.t.cpp
deleted file mode 100644
index 0f8caef..0000000
--- a/tests/unit/security/pib/pib-memory.t.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2018 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/pib/pib-memory.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace ndn {
-namespace security {
-namespace pib {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(Pib)
-BOOST_AUTO_TEST_SUITE(TestPibMemory)
-
-// Functionality is tested as part of pib-impl.t.cpp
-
-BOOST_AUTO_TEST_SUITE_END() // TestPibMemory
-BOOST_AUTO_TEST_SUITE_END() // Pib
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace pib
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit/security/pib/pib-sqlite3.t.cpp b/tests/unit/security/pib/pib-sqlite3.t.cpp
deleted file mode 100644
index 5b27d29..0000000
--- a/tests/unit/security/pib/pib-sqlite3.t.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2018 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace ndn {
-namespace security {
-namespace pib {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(Pib)
-BOOST_AUTO_TEST_SUITE(TestPibSqlite3)
-
-// Functionality is tested as part of pib-impl.t.cpp
-
-BOOST_AUTO_TEST_SUITE_END() // TestPibSqlite3
-BOOST_AUTO_TEST_SUITE_END() // Pib
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace pib
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit/security/pib/pib.t.cpp b/tests/unit/security/pib/pib.t.cpp
index 29787e2..c40cddc 100644
--- a/tests/unit/security/pib/pib.t.cpp
+++ b/tests/unit/security/pib/pib.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,7 +20,7 @@
*/
#include "ndn-cxx/security/pib/pib.hpp"
-#include "ndn-cxx/security/pib/pib-memory.hpp"
+#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/security/pib/pib-data-fixture.hpp"
@@ -43,25 +43,12 @@
Pib pib("pib-memory", "", make_shared<PibMemory>());
Identity id = pib.addIdentity(id1);
-
- BOOST_CHECK_EQUAL(static_cast<bool>(id), true);
+ BOOST_CHECK(id);
BOOST_CHECK_EQUAL(!id, false);
- if (id)
- BOOST_CHECK(true);
- else
- BOOST_CHECK(false);
-
- // key
Key key = id.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
-
- BOOST_CHECK_EQUAL(static_cast<bool>(key), true);
+ BOOST_CHECK(key);
BOOST_CHECK_EQUAL(!key, false);
-
- if (key)
- BOOST_CHECK(true);
- else
- BOOST_CHECK(false);
}
BOOST_AUTO_TEST_CASE(TpmLocator)
diff --git a/tests/unit/security/tpm/back-end-wrapper-file.hpp b/tests/unit/security/tpm/back-end-wrapper-file.hpp
index 89c58d0..16b9bf2 100644
--- a/tests/unit/security/tpm/back-end-wrapper-file.hpp
+++ b/tests/unit/security/tpm/back-end-wrapper-file.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,7 +22,7 @@
#ifndef NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_FILE_HPP
#define NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_FILE_HPP
-#include "ndn-cxx/security/tpm/back-end-file.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-file.hpp"
#include <boost/filesystem.hpp>
diff --git a/tests/unit/security/tpm/back-end-wrapper-mem.hpp b/tests/unit/security/tpm/back-end-wrapper-mem.hpp
index a8b44fc..67dd7e0 100644
--- a/tests/unit/security/tpm/back-end-wrapper-mem.hpp
+++ b/tests/unit/security/tpm/back-end-wrapper-mem.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,7 +22,7 @@
#ifndef NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_MEM_HPP
#define NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_MEM_HPP
-#include "ndn-cxx/security/tpm/back-end-mem.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-mem.hpp"
namespace ndn {
namespace security {
diff --git a/tests/unit/security/tpm/back-end-wrapper-osx.hpp b/tests/unit/security/tpm/back-end-wrapper-osx.hpp
index cc582d1..124c897 100644
--- a/tests/unit/security/tpm/back-end-wrapper-osx.hpp
+++ b/tests/unit/security/tpm/back-end-wrapper-osx.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,8 +22,8 @@
#ifndef NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_OSX_HPP
#define NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_OSX_HPP
-#include "ndn-cxx/security/tpm/back-end-osx.hpp"
-#include "ndn-cxx/security/tpm/key-handle-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
+#include "ndn-cxx/security/tpm/impl/key-handle-osx.hpp"
#include <cstdlib>
diff --git a/wscript b/wscript
index 462e083..d04c8bc 100644
--- a/wscript
+++ b/wscript
@@ -255,7 +255,7 @@
EXTRA_LDFLAGS=' '.join([('-L%s' % i) for i in uniq(pkgconfig_ldflags)]),
EXTRA_LINKFLAGS=' '.join(uniq(pkgconfig_linkflags)),
EXTRA_INCLUDES=' '.join([('-I%s' % i) for i in uniq(pkgconfig_includes)]),
- EXTRA_CXXFLAGS=' '.join(uniq(pkgconfig_cxxflags)) + ' ' + ' '.join([('-D%s' % i) for i in uniq(pkgconfig_defines)]),
+ EXTRA_CXXFLAGS=' '.join(uniq(pkgconfig_cxxflags) + [('-D%s' % i) for i in uniq(pkgconfig_defines)]),
EXTRA_FRAMEWORKS=EXTRA_FRAMEWORKS)
if bld.env.WITH_TESTS: