Validation state for a data packet. More...
#include <validation-state.hpp>
Public Member Functions | |
DataValidationState (const Data &data, const DataValidationSuccessCallback &successCb, const DataValidationFailureCallback &failureCb) | |
Create validation state for data . More... | |
~DataValidationState () final | |
Destructor. More... | |
void | fail (const ValidationError &error) final |
Call the failure callback. More... | |
const Data & | getOriginalData () const |
Public Member Functions inherited from ndn::security::v2::ValidationState | |
ValidationState () | |
Create validation state. More... | |
virtual | ~ValidationState () |
boost::logic::tribool | getOutcome () const |
size_t | getDepth () const |
bool | hasSeenCertificateName (const Name &certName) |
Check if certName has been previously seen and record the supplied name. More... | |
void | addCertificate (const Certificate &cert) |
Add cert to the top of the certificate chain. More... | |
Public Member Functions inherited from ndn::TagHost | |
template<typename T > | |
shared_ptr< T > | getTag () const |
get a tag item More... | |
template<typename T > | |
void | setTag (shared_ptr< T > tag) const |
set a tag item More... | |
template<typename T > | |
void | removeTag () const |
remove tag item More... | |
Additional Inherited Members | |
Protected Attributes inherited from ndn::security::v2::ValidationState | |
boost::logic::tribool | m_outcome |
Validation state for a data packet.
Definition at line 161 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 88 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 99 of file validation-state.cpp.
References fail(), ndn::Data::getName(), ndn::security::v2::ValidationState::m_outcome, NDN_LOG_TRACE_DEPTH, ndn::Name::toUri(), and ndn::security::verifySignature().
|
finalvirtual |
Call the failure callback.
Implements ndn::security::v2::ValidationState.
Definition at line 132 of file validation-state.cpp.
References ndn::security::v2::ValidationState::m_outcome, and NDN_LOG_DEBUG_DEPTH.
Referenced by ~DataValidationState().
const Data & ndn::security::v2::DataValidationState::getOriginalData | ( | ) | const |
Definition at line 141 of file validation-state.cpp.
Referenced by ndn::security::v2::CertificateFetcherDirectFetch::doFetch().