ValidationState is an abstract base class for DataValidationState and InterestValidationState. More...
#include <validation-state.hpp>
Public Member Functions | |
| bool | hasOutcome () |
| Check if validation failed or success has been called. More... | |
| bool | isOutcomeFailed () |
| Check if validation failed has been called. More... | |
| bool | isOutcomeSuccess () |
| Check if validation success has been called. More... | |
| virtual void | fail (const ValidationError &error)=0 |
| Call the failure callback. | |
| size_t | getDepth () const |
| Get the depth of the certificate chain. More... | |
| bool | hasSeenCertificateName (const Name &certificateName) |
| Check if certificateName has been previously seen, and record the supplied name. More... | |
| void | addCertificate (const CertificateV2 &certificate) |
| Add the certificate to the top of the certificate chain. More... | |
Protected Member Functions | |
| void | setOutcome (bool outcome) |
| Set the outcome to the given value, and set hasOutcome_ true. More... | |
Friends | |
| class | Validator |
ValidationState is an abstract base class for DataValidationState and InterestValidationState.
One instance of the validation state is kept for the validation of the whole certificate chain.
The state collects the certificate chain that adheres to the selected validation policy to validate data or interest packets. Certificate, data, and interest packet signatures are verified only after the validator determines that the chain terminates with a trusted certificate (a trusted anchor or a previously validated certificate). This model allows filtering out invalid certificate chains without incurring (costly) cryptographic signature verification overhead and mitigates some forms of denial-of-service attacks.
A validation policy and/or key fetcher may add custom information associated with the validation state using tags.
|
inline |
Add the certificate to the top of the certificate chain.
If the certificate chain is empty, then the certificate should be the signer of the original packet. If the certificate chain is not empty, then the certificate should be the signer of the front of the certificate chain.
| certificate | The certificate to add, which is copied. |
|
inline |
Get the depth of the certificate chain.
|
inline |
Check if validation failed or success has been called.
|
inline |
Check if certificateName has been previously seen, and record the supplied name.
| certificateName | The certificate name, which is copied. |
|
inline |
Check if validation failed has been called.
|
inline |
Check if validation success has been called.
|
protected |
Set the outcome to the given value, and set hasOutcome_ true.
| outcome | The outcome. |
| std::runtime_error | If this ValidationState already has an outcome. |
1.8.6