24 #ifndef NDN_CERTIFICATE_CACHE_HPP
25 #define NDN_CERTIFICATE_CACHE_HPP
28 #include "../certificate/identity-certificate.hpp"
58 std::map<std::string, Blob>::iterator entry
59 (cache_.find(certificateName.
toUri()));
60 if (entry != cache_.end())
71 ptr_lib::shared_ptr<IdentityCertificate>
74 std::map<std::string, Blob>::const_iterator entry
75 (cache_.find(certificateName.
toUri()));
76 if (entry == cache_.end())
77 return ptr_lib::shared_ptr<IdentityCertificate>();
80 Blob certData = entry->second;
81 cert->wireDecode(certData);
96 std::map<std::string, Blob> cache_;
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
std::string toUri(bool includeScheme=false) const
Encode this name as a URI.
Definition: name.cpp:305
Definition: identity-certificate.hpp:30
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
SignedBlob wireEncode(WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const
Encode this Data for a particular wire format.
Definition: data.cpp:130
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
ptr_lib::shared_ptr< IdentityCertificate > getCertificate(const Name &certificateName) const
Fetch a certificate from the cache.
Definition: certificate-cache.hpp:72
void insertCertificate(const IdentityCertificate &certificate)
Insert the certificate into the cache.
Definition: certificate-cache.hpp:44
void reset()
Clear all certificates from the store.
Definition: certificate-cache.hpp:89
Name getPrefix(int nComponents) const
Return a new Name with the first nComponents components of this Name.
Definition: name.hpp:758
void deleteCertificate(const Name &certificateName)
Remove a certificate from the cache.
Definition: certificate-cache.hpp:56
A CertificateCache is used to save other users' certificate during verification.
Definition: certificate-cache.hpp:36