security: Reorganizing source code to prepare for support of two version of NDN certificates
This commit also removes unused ndn_digestSha256 function and deprecates
crypto::sha256 in favor of crypto::computeSha256Digest in util/crypto.hpp.
Change-Id: I24ee50ff073a96b868633bdf2cfade412d3605f3
Refs: #3098
diff --git a/tests/unit-tests/security/dummy-keychain.cpp b/tests/unit-tests/security/dummy-keychain.cpp
index 27eccb2..524fc0c 100644
--- a/tests/unit-tests/security/dummy-keychain.cpp
+++ b/tests/unit-tests/security/dummy-keychain.cpp
@@ -105,20 +105,20 @@
}
void
-DummyPublicInfo::addKey(const Name& keyName, const PublicKey& publicKey)
+DummyPublicInfo::addKey(const Name& keyName, const v1::PublicKey& publicKey)
{
}
-shared_ptr<PublicKey>
+shared_ptr<v1::PublicKey>
DummyPublicInfo::getPublicKey(const Name& keyName)
{
- static shared_ptr<PublicKey> publicKey = nullptr;
+ static shared_ptr<v1::PublicKey> publicKey = nullptr;
if (publicKey == nullptr) {
typedef boost::iostreams::stream<boost::iostreams::array_source> arrayStream;
arrayStream
is(reinterpret_cast<const char*>(DUMMY_CERT), sizeof(DUMMY_CERT));
- auto cert = io::load<IdentityCertificate>(is, io::NO_ENCODING);
- publicKey = make_shared<PublicKey>(cert->getPublicKeyInfo());
+ auto cert = io::load<v1::IdentityCertificate>(is, io::NO_ENCODING);
+ publicKey = make_shared<v1::PublicKey>(cert->getPublicKeyInfo());
}
return publicKey;
@@ -137,19 +137,19 @@
}
void
-DummyPublicInfo::addCertificate(const IdentityCertificate& certificate)
+DummyPublicInfo::addCertificate(const v1::IdentityCertificate& certificate)
{
}
-shared_ptr<IdentityCertificate>
+shared_ptr<v1::IdentityCertificate>
DummyPublicInfo::getCertificate(const Name& certificateName)
{
- static shared_ptr<IdentityCertificate> cert = nullptr;
+ static shared_ptr<v1::IdentityCertificate> cert = nullptr;
if (cert == nullptr) {
typedef boost::iostreams::stream<boost::iostreams::array_source> arrayStream;
arrayStream
is(reinterpret_cast<const char*>(DUMMY_CERT), sizeof(DUMMY_CERT));
- cert = io::load<IdentityCertificate>(is, io::BASE_64);
+ cert = io::load<v1::IdentityCertificate>(is, io::BASE_64);
}
return cert;
@@ -316,7 +316,7 @@
{
}
-shared_ptr<PublicKey>
+shared_ptr<v1::PublicKey>
DummyTpm::getPublicKeyFromTpm(const Name& keyName)
{
return nullptr;