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>
83 return m_certificateChain.size();
114 verifyOriginalPacket(
const optional<Certificate>& trustedCert) = 0;
120 bypassValidation() = 0;
137 verifyCertificateChain(
const Certificate& trustedCert);
140 boost::logic::tribool
m_outcome{boost::logic::indeterminate};
143 std::unordered_set<Name> m_seenCertificateNames;
151 std::list<Certificate> m_certificateChain;
194 verifyOriginalPacket(
const optional<Certificate>& trustedCert)
final;
197 bypassValidation() final;
246 verifyOriginalPacket(
const optional<Certificate>& trustedCert)
final;
249 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.
Validation state for a data packet.
const Data & getOriginalData() const
~DataValidationState() final
Destructor.
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.
const Interest & getOriginalInterest() const
util::Signal< InterestValidationState, Interest > afterSuccess
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.
virtual void fail(const ValidationError &error)=0
Call the failure callback.
boost::logic::tribool getOutcome() const noexcept
void addCertificate(const Certificate &cert)
Add cert to the top of the certificate chain.
boost::logic::tribool m_outcome
size_t getDepth() const noexcept
Interface for validating data and interest packets.
Provides a lightweight signal / event system.
std::function< void(const Data &)> DataValidationSuccessCallback
Callback to report a successful Data validation.
std::function< void(const Data &, const ValidationError &)> DataValidationFailureCallback
Callback to report a failed Data validation.
std::function< void(const Interest &)> InterestValidationSuccessCallback
Callback to report a successful Interest validation.
std::function< void(const Interest &, const ValidationError &)> InterestValidationFailureCallback
Callback to report a failed Interest validation.