23 #ifndef NDN_CERTIFICATE_STORAGE_HPP
24 #define NDN_CERTIFICATE_STORAGE_HPP
26 #include "certificate-cache-v2.hpp"
27 #include "trust-anchor-container.hpp"
38 : verifiedCertificateCache_(3600 * 1000.0),
39 unverifiedCertificateCache_(300 * 1000.0)
49 ptr_lib::shared_ptr<CertificateV2>
68 unverifiedCertificateCache_.
insert(certificate);
102 trustAnchors_.
insert(groupId, certificate);
121 (
const std::string& groupId,
const std::string& path,
124 trustAnchors_.
insert(groupId, path, refreshPeriod, isDirectory);
140 verifiedCertificateCache_.
insert(certificate);
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:114
void cacheVerifiedCertificate(const CertificateV2 &certificate)
Cache the verified certificate a period of time (1 hour).
Definition: certificate-storage.hpp:138
void resetAnchors()
Remove any previously loaded static or dynamic trust anchors.
Definition: certificate-storage.hpp:131
void setCacheNowOffsetMilliseconds_(Milliseconds nowOffsetMilliseconds)
Set the offset when the cache insert() and refresh() get the current time, which should only be used ...
Definition: certificate-storage.hpp:155
void insert(const std::string &groupId, const CertificateV2 &certificate)
Insert a static trust anchor.
const CertificateCacheV2 & getUnverifiedCertificateCache() const
Get the unverified certificate cache.
Definition: certificate-storage.hpp:90
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
void cacheUnverifiedCertificate(const CertificateV2 &certificate)
Cache the unverified certificate for a period of time (5 minutes).
Definition: certificate-storage.hpp:66
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
const CertificateCacheV2 & getVerifiedCertificateCache() const
Get the verified certificate cache.
Definition: certificate-storage.hpp:83
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:43
The CertificateStorage class stores trusted anchors and has a verified certificate cache...
Definition: certificate-storage.hpp:35
void insert(const CertificateV2 &certificate)
Insert the certificate into the cache.
Definition: certificate-cache-v2.cpp:42
A CertificateCacheV2 holds other user's verified certificates in security v2 format CertificateV2...
Definition: certificate-cache-v2.hpp:38
void clear()
Remove all static and dynamic anchors.
Definition: trust-anchor-container.hpp:94
void setNowOffsetMilliseconds_(Milliseconds nowOffsetMilliseconds)
Set the offset when insert() and refresh() get the current time, which should only be used for testin...
Definition: certificate-cache-v2.hpp:109
void clear()
Clear all certificates from the cache.
Definition: certificate-cache-v2.hpp:90
void loadAnchor(const std::string &groupId, const CertificateV2 &certificate)
Load a static trust anchor.
Definition: certificate-storage.hpp:100
void resetVerifiedCertificates()
Remove any cached verified certificates.
Definition: certificate-storage.hpp:147
bool isCertificateKnown(const Name &certificatePrefix)
Check if the certificate with the given name prefix exists in the verified cache, the unverified cach...
Definition: certificate-storage.cpp:43
ptr_lib::shared_ptr< CertificateV2 > findTrustedCertificate(const Interest &interestForCertificate)
Find a trusted certificate in the trust anchor container or in the verified cache.
Definition: certificate-storage.cpp:31
A TrustAnchorContainer represents a container for trust anchors.
Definition: trust-anchor-container.hpp:49
const TrustAnchorContainer & getTrustAnchors() const
Get the trust anchor container.
Definition: certificate-storage.hpp:76