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/src/security/validator-config.hpp b/src/security/validator-config.hpp
index db8d17d..8d801ad 100644
--- a/src/security/validator-config.hpp
+++ b/src/security/validator-config.hpp
@@ -31,6 +31,7 @@
#include "conf/common.hpp"
namespace ndn {
+namespace security {
class ValidatorConfig : public Validator
{
@@ -160,20 +161,20 @@
{
}
- const std::list<shared_ptr<IdentityCertificate>>&
+ const std::list<shared_ptr<v1::IdentityCertificate>>&
getAll() const
{
return m_certificates;
}
void
- add(shared_ptr<IdentityCertificate> certificate)
+ add(shared_ptr<v1::IdentityCertificate> certificate)
{
m_certificates.push_back(certificate);
}
protected:
- std::list<shared_ptr<IdentityCertificate>> m_certificates;
+ std::list<shared_ptr<v1::IdentityCertificate>> m_certificates;
};
class DynamicTrustAnchorContainer : public TrustAnchorContainer
@@ -233,9 +234,9 @@
typedef security::conf::Rule<Data> DataRule;
typedef std::vector<shared_ptr<InterestRule>> InterestRuleList;
typedef std::vector<shared_ptr<DataRule>> DataRuleList;
- typedef std::map<Name, shared_ptr<IdentityCertificate>> AnchorList;
+ typedef std::map<Name, shared_ptr<v1::IdentityCertificate>> AnchorList;
typedef std::list<DynamicTrustAnchorContainer> DynamicContainers; // sorted by m_lastRefresh
- typedef std::list<shared_ptr<IdentityCertificate>> CertificateList;
+ typedef std::list<shared_ptr<v1::IdentityCertificate>> CertificateList;
/**
@@ -262,6 +263,10 @@
const time::system_clock::Duration& m_keyTimestampTtl;
};
+} // namespace security
+
+using security::ValidatorConfig;
+
} // namespace ndn
#endif // NDN_SECURITY_VALIDATOR_CONFIG_HPP