Validator with "accept-all" policy and offline certificate fetcher.
More...
#include <validator-null.hpp>
|
| ValidatorNull () |
|
void | cacheUnverifiedCert (Certificate &&cert) |
| Cache unverified certificate for a period of time (5 minutes) More...
|
|
void | cacheVerifiedCertificate (Certificate &&cert) |
| Cache verified cert a period of time (1 hour) More...
|
|
const Certificate * | findTrustedCert (const Interest &interestForCert) const |
| Find a trusted certificate in trust anchor container or in verified cache. More...
|
|
CertificateFetcher & | getFetcher () |
|
size_t | getMaxDepth () const |
|
ValidationPolicy & | getPolicy () |
|
const TrustAnchorContainer & | getTrustAnchors () const |
|
const CertificateCache & | getUnverifiedCertCache () const |
|
const CertificateCache & | getVerifiedCertCache () const |
|
bool | isCertKnown (const Name &certPrefix) const |
| Check if certificate exists in verified, unverified cache, or in the set of trust anchors. More...
|
|
void | loadAnchor (const std::string &groupId, Certificate &&cert) |
| load static trust anchor. More...
|
|
void | loadAnchor (const std::string &groupId, const std::string &certfilePath, time::nanoseconds refreshPeriod, bool isDir=false) |
| load dynamic trust anchors. More...
|
|
void | resetAnchors () |
| remove any previously loaded static or dynamic trust anchor More...
|
|
void | resetVerifiedCertificates () |
| Remove any cached verified certificates. More...
|
|
void | setMaxDepth (size_t depth) |
| Set the maximum depth of the certificate chain. More...
|
|
void | validate (const Data &data, const DataValidationSuccessCallback &successCb, const DataValidationFailureCallback &failureCb) |
| Asynchronously validate data . More...
|
|
void | validate (const Interest &interest, const InterestValidationSuccessCallback &successCb, const InterestValidationFailureCallback &failureCb) |
| Asynchronously validate interest . More...
|
|
Validator with "accept-all" policy and offline certificate fetcher.
Definition at line 34 of file validator-null.hpp.
ndn::security::v2::ValidatorNull::ValidatorNull |
( |
| ) |
|
void ndn::security::v2::CertificateStorage::cacheUnverifiedCert |
( |
Certificate && |
cert | ) |
|
|
inherited |
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.
void ndn::security::v2::CertificateStorage::cacheVerifiedCert |
( |
Certificate && |
cert | ) |
|
|
protectedinherited |
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.
void ndn::security::v2::Validator::cacheVerifiedCertificate |
( |
Certificate && |
cert | ) |
|
|
inherited |
Cache verified cert
a period of time (1 hour)
- Todo:
- Add ability to customize time period
Definition at line 204 of file validator.cpp.
const Certificate * ndn::security::v2::CertificateStorage::findTrustedCert |
( |
const Interest & |
interestForCert | ) |
const |
|
inherited |
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.
size_t ndn::security::v2::Validator::getMaxDepth |
( |
| ) |
const |
|
inherited |
- Returns
- The maximum depth of the certificate chain
Definition at line 69 of file validator.cpp.
const CertificateCache & ndn::security::v2::CertificateStorage::getUnverifiedCertCache |
( |
| ) |
const |
|
inherited |
const CertificateCache & ndn::security::v2::CertificateStorage::getVerifiedCertCache |
( |
| ) |
const |
|
inherited |
bool ndn::security::v2::CertificateStorage::isCertKnown |
( |
const Name & |
certPrefix | ) |
const |
|
inherited |
Check if certificate exists in verified, unverified cache, or in the set of trust anchors.
Definition at line 47 of file certificate-storage.cpp.
void ndn::security::v2::Validator::loadAnchor |
( |
const std::string & |
groupId, |
|
|
Certificate && |
cert |
|
) |
| |
|
inherited |
load static trust anchor.
Static trust anchors are permanently associated with the validator and never expire.
- Parameters
-
Definition at line 185 of file validator.cpp.
void ndn::security::v2::Validator::loadAnchor |
( |
const std::string & |
groupId, |
|
|
const std::string & |
certfilePath, |
|
|
time::nanoseconds |
refreshPeriod, |
|
|
bool |
isDir = false |
|
) |
| |
|
inherited |
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 191 of file validator.cpp.
void ndn::security::v2::Validator::resetAnchors |
( |
| ) |
|
|
inherited |
remove any previously loaded static or dynamic trust anchor
Definition at line 198 of file validator.cpp.
void ndn::security::v2::Validator::resetVerifiedCertificates |
( |
| ) |
|
|
inherited |
Remove any cached verified certificates.
Definition at line 210 of file validator.cpp.
void ndn::security::v2::CertificateStorage::resetVerifiedCerts |
( |
| ) |
|
|
protectedinherited |
void ndn::security::v2::Validator::setMaxDepth |
( |
size_t |
depth | ) |
|
|
inherited |
Set the maximum depth of the certificate chain.
Definition at line 63 of file validator.cpp.
Asynchronously validate data
.
- Note
successCb
and failureCb
must not be nullptr
Definition at line 75 of file validator.cpp.
Asynchronously validate interest
.
- Note
successCb
and failureCb
must not be nullptr
Definition at line 95 of file validator.cpp.