Validation state for a data packet. More...
#include <ndn-cxx/security/validation-state.hpp>
Inheritance diagram for ndn::security::v2::DataValidationState:
Collaboration diagram for ndn::security::v2::DataValidationState:Public Member Functions | |
| DataValidationState (const Data &data, const DataValidationSuccessCallback &successCb, const DataValidationFailureCallback &failureCb) | |
Create validation state for data. More... | |
| ~DataValidationState () final | |
| Destructor. More... | |
| void | addCertificate (const Certificate &cert) |
Add cert to the top of the certificate chain. More... | |
| void | fail (const ValidationError &error) final |
| Call the failure callback. More... | |
| size_t | getDepth () const noexcept |
| const Data & | getOriginalData () const |
| boost::logic::tribool | getOutcome () const noexcept |
| template<typename T > | |
| shared_ptr< T > | getTag () const |
| Get a tag item. More... | |
| bool | hasSeenCertificateName (const Name &certName) |
Check if certName has been previously seen and record the supplied name. More... | |
| template<typename T > | |
| void | removeTag () const |
| Remove a tag item. More... | |
| template<typename T > | |
| void | setTag (shared_ptr< T > tag) const |
| Set (add or replace) a tag item. More... | |
Protected Attributes | |
| boost::logic::tribool | m_outcome {boost::logic::indeterminate} |
Validation state for a data packet.
Definition at line 159 of file validation-state.hpp.
| ndn::security::v2::DataValidationState::DataValidationState | ( | const Data & | data, |
| const DataValidationSuccessCallback & | successCb, | ||
| const DataValidationFailureCallback & | failureCb | ||
| ) |
Create validation state for data.
The caller must ensure that state instance is valid until validation finishes (i.e., until after validateCertificateChain() and validateOriginalPacket() are called)
Definition at line 75 of file validation-state.cpp.
|
final |
Destructor.
If neither success callback nor failure callback was called, the destructor will call failure callback with IMPLEMENTATION_ERROR error code.
Definition at line 86 of file validation-state.cpp.
|
inherited |
Add cert to the top of the certificate chain.
If m_certificateChain is empty, cert should be the signer of the original packet. If m_certificateChain is not empty, cert should be the signer of m_certificateChain.front().
Definition at line 49 of file validation-state.cpp.
|
finalvirtual |
Call the failure callback.
Implements ndn::security::v2::ValidationState.
Definition at line 118 of file validation-state.cpp.
|
inlinenoexceptinherited |
Definition at line 81 of file validation-state.hpp.
|
inline |
Definition at line 187 of file validation-state.hpp.
|
inlinenoexceptinherited |
Definition at line 66 of file validation-state.hpp.
|
inherited |
Get a tag item.
| T | type of the tag, which must be a subclass of ndn::Tag |
| nullptr | if no Tag of type T is stored |
Definition at line 67 of file tag-host.hpp.
|
inherited |
Check if certName has been previously seen and record the supplied name.
Definition at line 43 of file validation-state.cpp.
|
inherited |
Remove a tag item.
Definition at line 94 of file tag-host.hpp.
|
inherited |
Set (add or replace) a tag item.
| T | type of the tag, which must be a subclass of ndn::Tag |
Definition at line 80 of file tag-host.hpp.
|
protectedinherited |
Definition at line 140 of file validation-state.hpp.