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/certificate-cache-ttl.hpp b/src/security/certificate-cache-ttl.hpp
index 55cbc5a..e0ef837 100644
--- a/src/security/certificate-cache-ttl.hpp
+++ b/src/security/certificate-cache-ttl.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2014 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).
*
@@ -29,6 +29,7 @@
#include "../util/scheduler.hpp"
namespace ndn {
+namespace security {
/**
* @brief Cache of validated certificates with freshness-based eviction policy
@@ -47,9 +48,9 @@
~CertificateCacheTtl();
virtual void
- insertCertificate(shared_ptr<const IdentityCertificate> certificate);
+ insertCertificate(shared_ptr<const v1::IdentityCertificate> certificate);
- virtual shared_ptr<const IdentityCertificate>
+ virtual shared_ptr<const v1::IdentityCertificate>
getCertificate(const Name& certificateNameWithoutVersion);
virtual void
@@ -60,7 +61,7 @@
private:
void
- insert(shared_ptr<const IdentityCertificate> certificate);
+ insert(shared_ptr<const v1::IdentityCertificate> certificate);
void
remove(const Name& certificateName);
@@ -69,7 +70,7 @@
removeAll();
protected:
- typedef std::map<Name, std::pair<shared_ptr<const IdentityCertificate>, EventId> > Cache;
+ typedef std::map<Name, std::pair<shared_ptr<const v1::IdentityCertificate>, EventId> > Cache;
time::seconds m_defaultTtl;
Cache m_cache;
@@ -77,6 +78,10 @@
Scheduler m_scheduler;
};
+} // namespace security
+
+using security::CertificateCacheTtl;
+
} // namespace ndn
#endif // NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP