22 #ifndef NDN_CXX_SECURITY_VALIDATION_POLICY_HPP
23 #define NDN_CXX_SECURITY_VALIDATION_POLICY_HPP
39 const shared_ptr<ValidationState>& state)>;
140 checkPolicy(
static_cast<const Data&
>(certificate), state, continueValidation);
Represents a Data packet.
Represents an Interest packet.
Represents an absolute name.
Represents a SignatureInfo or InterestSignatureInfo TLV element.
Represents an NDN certificate.
Abstraction that implements a validation policy for Interest and Data packets.
virtual ~ValidationPolicy()=default
void setValidator(Validator &validator)
Set validator to which the policy is associated.
virtual void checkPolicy(const Interest &interest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)=0
Check interest against the policy.
std::function< void(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state)> ValidationContinuation
ValidationPolicy & getInnerPolicy()
Return the inner policy.
virtual void checkPolicy(const Data &data, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)=0
Check data against the policy.
bool hasInnerPolicy() const
Check if inner policy is set.
void setInnerPolicy(unique_ptr< ValidationPolicy > innerPolicy)
Set inner policy.
virtual void checkPolicy(const Certificate &certificate, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
Check certificate against the policy.
unique_ptr< ValidationPolicy > m_innerPolicy
Interface for validating data and interest packets.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
Contains the ndn-cxx security framework.
Name extractIdentityNameFromKeyLocator(const Name &keyLocator)
Extract identity name from key, version-less certificate, or certificate name.
SignatureInfo getSignatureInfo(const Interest &interest, ValidationState &state)
Extract SignatureInfo from a signed Interest.
Name getKeyLocatorName(const SignatureInfo &si, ValidationState &state)
Extract the KeyLocator name from a SignatureInfo element.