22 #ifndef NDN_CXX_SECURITY_VALIDATION_STATE_HPP
23 #define NDN_CXX_SECURITY_VALIDATION_STATE_HPP
32 #include <unordered_set>
33 #include <boost/logic/tribool.hpp>
116 verifyOriginalPacket(
const optional<Certificate>& trustedCert) = 0;
122 bypassValidation() = 0;
139 verifyCertificateChain(
const Certificate& trustedCert);
145 std::unordered_set<Name> m_seenCertificateNames;
153 std::list<Certificate> m_certificateChain;
193 verifyOriginalPacket(
const optional<Certificate>& trustedCert)
final;
196 bypassValidation()
final;
242 verifyOriginalPacket(
const optional<Certificate>& trustedCert)
final;
245 bypassValidation() final;
Represents a Data packet.
Represents an Interest packet.
Represents an absolute name.
provides a tag type for simple types
Base class to store tag information (e.g., inside Interest and Data packets)
Represents an NDN certificate following the version 2.0 format.
Validation state for a data packet.
~DataValidationState() final
Destructor.
const Data & getOriginalData() const
void fail(const ValidationError &error) final
Call the failure callback.
DataValidationState(const Data &data, const DataValidationSuccessCallback &successCb, const DataValidationFailureCallback &failureCb)
Create validation state for data.
Validation state for an interest packet.
InterestValidationState(const Interest &interest, const InterestValidationSuccessCallback &successCb, const InterestValidationFailureCallback &failureCb)
Create validation state for interest.
~InterestValidationState() final
Destructor.
const Interest & getOriginalInterest() const
util::Signal< InterestValidationState, Interest > afterSuccess
void fail(const ValidationError &error) final
Call the failure callback.
Validation error code and optional detailed error message.
virtual ~ValidationState()
bool hasSeenCertificateName(const Name &certName)
Check if certName has been previously seen and record the supplied name.
ValidationState()
Create validation state.
virtual void fail(const ValidationError &error)=0
Call the failure callback.
boost::logic::tribool getOutcome() const
void addCertificate(const Certificate &cert)
Add cert to the top of the certificate chain.
boost::logic::tribool m_outcome
Interface for validating data and interest packets.
provides a lightweight signal / event system
function< void(const Interest &interest, const ValidationError &error)> InterestValidationFailureCallback
Callback to report a failed Interest validation.
function< void(const Data &data)> DataValidationSuccessCallback
Callback to report a successful Data validation.
function< void(const Data &data, const ValidationError &error)> DataValidationFailureCallback
Callback to report a failed Data validation.
function< void(const Interest &interest)> InterestValidationSuccessCallback
Callback to report a successful Interest validation.