Helper for validator that uses CommandInterest + Config policy and NetworkFetcher. More...
#include <ndn-cxx/security/validator-config.hpp>
Public Types | |
using | Options = v2::ValidationPolicyCommandInterest::Options |
Public Member Functions | |
ValidatorConfig (std::unique_ptr< v2::CertificateFetcher > fetcher, const Options &options=Options()) | |
ValidatorConfig (Face &face, const Options &options=Options()) | |
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 | load (const std::string &filename) |
void | load (const std::string &input, const std::string &filename) |
void | load (std::istream &input, const std::string &filename) |
void | load (const v2::validator_config::ConfigSection &configSection, const std::string &filename) |
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... | |
Protected Member Functions | |
void | cacheVerifiedCert (Certificate &&cert) |
Cache verified certificate a period of time (1 hour) More... | |
void | resetVerifiedCerts () |
Remove any cached verified certificates. More... | |
Protected Attributes | |
TrustAnchorContainer | m_trustAnchors |
CertificateCache | m_unverifiedCertCache |
CertificateCache | m_verifiedCertCache |
Helper for validator that uses CommandInterest + Config policy and NetworkFetcher.
Definition at line 35 of file validator-config.hpp.
Definition at line 39 of file validator-config.hpp.
|
explicit |
Definition at line 28 of file validator-config.cpp.
|
explicit |
Definition at line 36 of file validator-config.cpp.
|
inherited |
Cache unverified certificate for a period of time (5 minutes)
cert | The certificate packet |
Definition at line 86 of file certificate-storage.cpp.
|
protectedinherited |
Cache verified certificate a period of time (1 hour)
cert | The certificate packet |
Definition at line 74 of file certificate-storage.cpp.
|
inherited |
Cache verified cert
a period of time (1 hour)
Definition at line 204 of file validator.cpp.
|
inherited |
Find a trusted certificate in trust anchor container or in verified cache.
interestForCert | Interest for certificate |
Definition at line 35 of file certificate-storage.cpp.
|
inherited |
Definition at line 57 of file validator.cpp.
|
inherited |
Definition at line 69 of file validator.cpp.
|
inherited |
Definition at line 51 of file validator.cpp.
|
inherited |
Definition at line 92 of file certificate-storage.cpp.
|
inherited |
Definition at line 104 of file certificate-storage.cpp.
|
inherited |
Definition at line 98 of file certificate-storage.cpp.
|
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::ValidatorConfig::load | ( | const std::string & | filename | ) |
Definition at line 42 of file validator-config.cpp.
void ndn::security::ValidatorConfig::load | ( | const std::string & | input, |
const std::string & | filename | ||
) |
Definition at line 48 of file validator-config.cpp.
void ndn::security::ValidatorConfig::load | ( | std::istream & | input, |
const std::string & | filename | ||
) |
Definition at line 54 of file validator-config.cpp.
void ndn::security::ValidatorConfig::load | ( | const v2::validator_config::ConfigSection & | configSection, |
const std::string & | filename | ||
) |
Definition at line 60 of file validator-config.cpp.
|
inherited |
load static trust anchor.
Static trust anchors are permanently associated with the validator and never expire.
groupId | Certificate group id. |
cert | Certificate to load as a trust anchor. |
Definition at line 185 of file validator.cpp.
|
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).
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.
|
inherited |
remove any previously loaded static or dynamic trust anchor
Definition at line 198 of file validator.cpp.
|
inherited |
Remove any cached verified certificates.
Definition at line 210 of file validator.cpp.
|
protectedinherited |
Remove any cached verified certificates.
Definition at line 80 of file certificate-storage.cpp.
|
inherited |
Set the maximum depth of the certificate chain.
Definition at line 63 of file validator.cpp.
|
inherited |
Asynchronously validate data
.
successCb
and failureCb
must not be nullptr Definition at line 75 of file validator.cpp.
|
inherited |
Asynchronously validate interest
.
successCb
and failureCb
must not be nullptr Definition at line 95 of file validator.cpp.
|
protectedinherited |
Definition at line 134 of file certificate-storage.hpp.
|
protectedinherited |
Definition at line 136 of file certificate-storage.hpp.
|
protectedinherited |
Definition at line 135 of file certificate-storage.hpp.