Storage for trusted anchors, verified certificate cache, and unverified certificate cache.
More...
#include <ndn-cxx/security/certificate-storage.hpp>
Storage for trusted anchors, verified certificate cache, and unverified certificate cache.
Definition at line 36 of file certificate-storage.hpp.
◆ CertificateStorage()
ndn::security::v2::CertificateStorage::CertificateStorage |
( |
| ) |
|
◆ cacheUnverifiedCert()
void ndn::security::v2::CertificateStorage::cacheUnverifiedCert |
( |
Certificate && |
cert | ) |
|
Cache unverified certificate for a period of time (5 minutes).
- Parameters
-
cert | The certificate packet |
- Todo:
- Add ability to customize time period
Definition at line 86 of file certificate-storage.cpp.
◆ cacheVerifiedCert()
void ndn::security::v2::CertificateStorage::cacheVerifiedCert |
( |
Certificate && |
cert | ) |
|
|
protected |
Cache verified certificate a period of time (1 hour).
- Parameters
-
cert | The certificate packet |
- Todo:
- Add ability to customize time period
Definition at line 74 of file certificate-storage.cpp.
◆ findTrustedCert()
const Certificate * ndn::security::v2::CertificateStorage::findTrustedCert |
( |
const Interest & |
interestForCert | ) |
const |
Find a trusted certificate in trust anchor container or in verified cache.
- Parameters
-
- Returns
- Found certificate, nullptr if not found.
- Note
- The returned pointer may get invalidated after next findTrustedCert() or findCert() calls.
Definition at line 35 of file certificate-storage.cpp.
◆ getTrustAnchors()
◆ getUnverifiedCertCache()
const CertificateCache & ndn::security::v2::CertificateStorage::getUnverifiedCertCache |
( |
| ) |
const |
◆ getVerifiedCertCache()
const CertificateCache & ndn::security::v2::CertificateStorage::getVerifiedCertCache |
( |
| ) |
const |
◆ isCertKnown()
bool ndn::security::v2::CertificateStorage::isCertKnown |
( |
const Name & |
certPrefix | ) |
const |
Check if certificate exists in the verified/unverified cache or in the set of trust anchors.
Definition at line 47 of file certificate-storage.cpp.
◆ loadAnchor() [1/2]
void ndn::security::v2::CertificateStorage::loadAnchor |
( |
const std::string & |
groupId, |
|
|
Certificate && |
cert |
|
) |
| |
|
protected |
Load static trust anchor.
Static trust anchors are permanently associated with the validator and never expire.
- Parameters
-
Definition at line 55 of file certificate-storage.cpp.
◆ loadAnchor() [2/2]
void ndn::security::v2::CertificateStorage::loadAnchor |
( |
const std::string & |
groupId, |
|
|
const std::string & |
certfilePath, |
|
|
time::nanoseconds |
refreshPeriod, |
|
|
bool |
isDir = false |
|
) |
| |
|
protected |
Load dynamic trust anchors.
Dynamic trust anchors are associated with the validator for as long as the underlying trust anchor file (set of files) exist(s).
- Parameters
-
groupId | Certificate group id, must not be empty. |
certfilePath | Specifies the path to load the trust anchors. |
refreshPeriod | Refresh period for the trust anchors, must be positive. |
isDir | Tells whether the path is a directory or a single file. |
Definition at line 61 of file certificate-storage.cpp.
◆ resetAnchors()
void ndn::security::v2::CertificateStorage::resetAnchors |
( |
| ) |
|
|
protected |
◆ resetVerifiedCerts()
void ndn::security::v2::CertificateStorage::resetVerifiedCerts |
( |
| ) |
|
|
protected |
◆ m_trustAnchors
◆ m_unverifiedCertCache
◆ m_verifiedCertCache