22 #ifndef NDN_SECURITY_V2_VALIDATION_STATE_HPP 23 #define NDN_SECURITY_V2_VALIDATION_STATE_HPP 25 #include "../../tag-host.hpp" 28 #include "../../util/signal.hpp" 31 #include <unordered_set> 32 #include <boost/logic/tribool.hpp> 113 verifyOriginalPacket(
const Certificate& trustedCert) = 0;
119 bypassValidation() = 0;
136 verifyCertificateChain(
const Certificate& trustedCert);
142 std::unordered_set<Name> m_seenCertificateNames;
150 std::list<v2::Certificate> m_certificateChain;
190 verifyOriginalPacket(
const Certificate& trustedCert)
final;
193 bypassValidation()
final;
239 verifyOriginalPacket(
const Certificate& trustedCert)
final;
242 bypassValidation() final;
254 #endif // NDN_SECURITY_V2_VALIDATION_STATE_HPP ValidationState()
Create validation state.
DataValidationState(const Data &data, const DataValidationSuccessCallback &successCb, const DataValidationFailureCallback &failureCb)
Create validation state for data.
const Data & getOriginalData() const
Copyright (c) 2011-2015 Regents of the University of California.
The certificate following the certificate format naming convention.
void fail(const ValidationError &error) final
Call the failure callback.
const Interest & getOriginalInterest() const
function< void(const Data &data)> DataValidationSuccessCallback
Callback to report a successful Data validation.
bool hasSeenCertificateName(const Name &certName)
Check if certName has been previously seen and record the supplied name.
ndn security v2 Validator
Base class to store tag information (e.g., inside Interest and Data packets)
void addCertificate(const Certificate &cert)
Add cert to the top of the certificate chain.
represents an Interest packet
function< void(const Data &data, const ValidationError &error)> DataValidationFailureCallback
Callback to report a failed Data validation.
provides a lightweight signal / event system
Validation state for a data packet.
boost::logic::tribool getOutcome() const
Validation state for an interest packet.
virtual ~ValidationState()
util::Signal< InterestValidationState, Interest > afterSuccess
Represents an absolute name.
~InterestValidationState() final
Destructor.
void fail(const ValidationError &error) final
Call the failure callback.
function< void(const Interest &interest, const ValidationError &error)> InterestValidationFailureCallback
Callback to report a failed Interest validation.
InterestValidationState(const Interest &interest, const InterestValidationSuccessCallback &successCb, const InterestValidationFailureCallback &failureCb)
Create validation state for interest.
Validation error code and optional detailed error message.
~DataValidationState() final
Destructor.
virtual void fail(const ValidationError &error)=0
Call the failure callback.
Represents a Data packet.
boost::logic::tribool m_outcome
function< void(const Interest &interest)> InterestValidationSuccessCallback
Callback to report a successful Interest validation.
Interface for validating data and interest packets.