The CertificateStorage class stores trusted anchors and has a verified certificate cache, and an unverified certificate cache.
More...
#include <certificate-storage.hpp>
The CertificateStorage class stores trusted anchors and has a verified certificate cache, and an unverified certificate cache.
| void ndn::CertificateStorage::cacheUnverifiedCertificate |
( |
const CertificateV2 & |
certificate | ) |
|
|
inline |
Cache the unverified certificate for a period of time (5 minutes).
- Parameters
-
| certificate | The certificate packet, which is copied. |
| void ndn::CertificateStorage::cacheVerifiedCertificate |
( |
const CertificateV2 & |
certificate | ) |
|
|
inline |
Cache the verified certificate a period of time (1 hour).
- Parameters
-
| certificate | The certificate object, which is copied. |
| ptr_lib::shared_ptr< CertificateV2 > ndn::CertificateStorage::findTrustedCertificate |
( |
const Interest & |
interestForCertificate | ) |
|
Find a trusted certificate in the trust anchor container or in the verified cache.
- Parameters
-
| interestForCertificate | The Interest for the certificate. |
- Returns
- The found certificate, or null if not found.
Get the trust anchor container.
- Returns
- The trust anchor container.
| const CertificateCacheV2& ndn::CertificateStorage::getUnverifiedCertificateCache |
( |
| ) |
const |
|
inline |
Get the unverified certificate cache.
- Returns
- The unverified certificate cache.
Get the verified certificate cache.
- Returns
- The verified certificate cache.
| bool ndn::CertificateStorage::isCertificateKnown |
( |
const Name & |
certificatePrefix | ) |
|
Check if the certificate with the given name prefix exists in the verified cache, the unverified cache, or in the set of trust anchors.
- Parameters
-
| certificatePrefix | The certificate name prefix. |
- Returns
- True if the certificate is known.
| void ndn::CertificateStorage::loadAnchor |
( |
const std::string & |
groupId, |
|
|
const CertificateV2 & |
certificate |
|
) |
| |
|
inline |
Load a static trust anchor.
Static trust anchors are permanently associated with the validator and never expire.
- Parameters
-
| groupId | The certificate group id. |
| certificate | The certificate to load as a trust anchor, which is copied. |
| void ndn::CertificateStorage::loadAnchor |
( |
const std::string & |
groupId, |
|
|
const std::string & |
path, |
|
|
Milliseconds |
refreshPeriod, |
|
|
bool |
isDirectory = false |
|
) |
| |
|
inline |
Load dynamic trust anchors.
Dynamic trust anchors are associated with the validator for as long as the underlying trust anchor file (or set of files) exists.
- Parameters
-
| groupId | The certificate group id, which must not be empty. |
| path | The path to load the trust anchors. |
| refreshPeriod | The refresh time in milliseconds for the anchors under path. This must be positive. The relevant trust anchors will only be updated when find is called. |
| isDirectory | (optional) If true, then path is a directory. If false or omitted, it is a single file. |
- Exceptions
-
| void ndn::CertificateStorage::setCacheNowOffsetMilliseconds_ |
( |
Milliseconds |
nowOffsetMilliseconds | ) |
|
|
inline |
Set the offset when the cache insert() and refresh() get the current time, which should only be used for testing.
- Parameters
-
| nowOffsetMilliseconds | The offset in milliseconds. |
The documentation for this class was generated from the following files: