|
| | Validator (const ptr_lib::shared_ptr< ValidationPolicy > &policy, const ptr_lib::shared_ptr< CertificateFetcher > &certificateFetcher=ptr_lib::make_shared< CertificateFetcherOffline >()) |
| | Create a Validator with the policy and fetcher. More...
|
| |
| ValidationPolicy & | getPolicy () |
| | Get the ValidationPolicy given to the constructor. More...
|
| |
| CertificateFetcher & | getFetcher () |
| | Get the CertificateFetcher given to (or created in) the constructor. More...
|
| |
| void | setMaxDepth (size_t maxDepth) |
| | Set the maximum depth of the certificate chain. More...
|
| |
| size_t | getMaxDepth () const |
| | Get the maximum depth of the certificate chain. More...
|
| |
| void | validate (const Data &data, const DataValidationSuccessCallback &successCallback, const DataValidationFailureCallback &failureCallback) |
| | Asynchronously validate the Data packet. More...
|
| |
| void | validate (const Interest &interest, const InterestValidationSuccessCallback &successCallback, const InterestValidationFailureCallback &failureCallback) |
| | Asynchronously validate the Interest. More...
|
| |
ptr_lib::shared_ptr
< CertificateV2 > | findTrustedCertificate (const Interest &interestForCertificate) |
| | Find a trusted certificate in the trust anchor container or in the verified cache. More...
|
| |
| bool | 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. More...
|
| |
| void | cacheUnverifiedCertificate (const CertificateV2 &certificate) |
| | Cache the unverified certificate for a period of time (5 minutes). More...
|
| |
| const TrustAnchorContainer & | getTrustAnchors () const |
| | Get the trust anchor container. More...
|
| |
| const CertificateCacheV2 & | getVerifiedCertificateCache () const |
| | Get the verified certificate cache. More...
|
| |
| const CertificateCacheV2 & | getUnverifiedCertificateCache () const |
| | Get the unverified certificate cache. More...
|
| |
| void | loadAnchor (const std::string &groupId, const CertificateV2 &certificate) |
| | Load a static trust anchor. More...
|
| |
| void | loadAnchor (const std::string &groupId, const std::string &path, Milliseconds refreshPeriod, bool isDirectory=false) |
| | Load dynamic trust anchors. More...
|
| |
|
void | resetAnchors () |
| | Remove any previously loaded static or dynamic trust anchors.
|
| |
| void | cacheVerifiedCertificate (const CertificateV2 &certificate) |
| | Cache the verified certificate a period of time (1 hour). More...
|
| |
|
void | resetVerifiedCertificates () |
| | Remove any cached verified certificates.
|
| |
| void | setCacheNowOffsetMilliseconds_ (Milliseconds nowOffsetMilliseconds) |
| | Set the offset when the cache insert() and refresh() get the current time, which should only be used for testing. More...
|
| |
The Validator class provides an interface for validating data and interest packets.
Every time a validation process is initiated, it creates a ValidationState that exists until the validation finishes with either success or failure. This state serves several purposes: to record the Interest or Data packet being validated, to record the failure callback, to record certificates in the certification chain for the Interest or Data packet being validated, to record the names of the requested certificates in order to detect loops in the certificate chain, and to keep track of the validation chain size (also known as the validation "depth").
During validation, the policy and/or key fetcher can augment the validation state with policy- and fetcher-specific information using tags.
A Validator has a trust anchor cache to save static and dynamic trust anchors, a verified certificate cache for saving certificates that are already verified, and an unverified certificate cache for saving pre-fetched but not yet verified certificates.