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>
81 return m_certificateChain.size();
112 verifyOriginalPacket(
const std::optional<Certificate>& trustedCert) = 0;
118 bypassValidation() = 0;
135 verifyCertificateChain(
const Certificate& trustedCert);
138 boost::logic::tribool
m_outcome{boost::logic::indeterminate};
141 std::unordered_set<Name> m_seenCertificateNames;
149 std::list<Certificate> m_certificateChain;
192 verifyOriginalPacket(
const std::optional<Certificate>& trustedCert)
final;
195 bypassValidation() final;
244 verifyOriginalPacket(
const std::optional<Certificate>& trustedCert)
final;
247 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.
DataValidationState(const Data &data, const DataValidationSuccessCallback &successCb, const DataValidationFailureCallback &failureCb)
Create validation state for data.
const Data & getOriginalData() const
void fail(const ValidationError &error) final
Call the failure callback.
~DataValidationState() final
Destructor.
Validation state for an interest packet.
const Interest & getOriginalInterest() const
signal::Signal< InterestValidationState, Interest > afterSuccess
Validation error code and optional detailed error message.
size_t getDepth() const noexcept
boost::logic::tribool getOutcome() const noexcept
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.
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.
Contains the ndn-cxx security framework.
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.
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.