22 #ifndef NDN_CXX_SECURITY_VALIDATION_POLICY_HPP
23 #define NDN_CXX_SECURITY_VALIDATION_POLICY_HPP
41 const shared_ptr<ValidationState>& state)>;
142 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 void checkPolicy(const Interest &interest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)=0
Check interest against the policy.
ValidationPolicy & getInnerPolicy()
Return the inner policy.
void setValidator(Validator &validator)
Set validator to which the policy is associated.
std::function< void(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state)> ValidationContinuation
virtual void checkPolicy(const Certificate &certificate, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
Check certificate against the policy.
unique_ptr< ValidationPolicy > m_innerPolicy
bool hasInnerPolicy() const
Check if inner policy is set.
virtual void checkPolicy(const Data &data, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)=0
Check data against the policy.
void setInnerPolicy(unique_ptr< ValidationPolicy > innerPolicy)
Set inner policy.
virtual ~ValidationPolicy()=default
Interface for validating data and interest packets.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
Name getKeyLocatorName(const SignatureInfo &si, ValidationState &state)
Extract the KeyLocator name from a SignatureInfo element.
SignatureInfo getSignatureInfo(const Interest &interest, ValidationState &state)
Extract SignatureInfo from a signed Interest.
Name extractIdentityNameFromKeyLocator(const Name &keyLocator)
Extract identity name from key, version-less certificate, or certificate name.