23 #ifndef NDN_CERTIFICATE_CACHE_V2_HPP
24 #define NDN_CERTIFICATE_CACHE_V2_HPP
28 #include "../../interest.hpp"
29 #include "certificate-v2.hpp"
64 ptr_lib::shared_ptr<CertificateV2>
65 find(
const Name& certificatePrefix)
const;
75 ptr_lib::shared_ptr<CertificateV2>
92 certificatesByName_.clear();
93 nextRefreshTime_ = DBL_MAX;
111 nowOffsetMilliseconds_ = nowOffsetMilliseconds;
127 (
const ptr_lib::shared_ptr<CertificateV2>& certificate,
129 : certificate_(certificate), removalTime_(removalTime)
137 ptr_lib::shared_ptr<CertificateV2> certificate_;
151 std::map<Name, Entry> certificatesByName_;
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:114
CertificateCacheV2(Milliseconds maxLifetimeMilliseconds=getDefaultLifetime())
Create a CertificateCacheV2.
Definition: certificate-cache-v2.cpp:34
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
static Milliseconds getDefaultLifetime()
Get the default maximum lifetime (1 hour).
Definition: certificate-cache-v2.hpp:101
void deleteCertificate(const Name &certificateName)
Remove the certificate whose name equals the given name.
Definition: certificate-cache-v2.cpp:110
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:43
void insert(const CertificateV2 &certificate)
Insert the certificate into the cache.
Definition: certificate-cache-v2.cpp:42
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:119
A CertificateCacheV2 holds other user's verified certificates in security v2 format CertificateV2...
Definition: certificate-cache-v2.hpp:38
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
ptr_lib::shared_ptr< CertificateV2 > find(const Name &certificatePrefix) const
Find the certificate by the given key name.
Definition: certificate-cache-v2.cpp:69