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 an NDN certificate following the version 2.0 format.
Abstraction that implements validation policy for Data and Interest 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 Data &data, ValidationState &state)
extract KeyLocator.Name from a Data packet
Name extractIdentityNameFromKeyLocator(const Name &keyLocator)
Extract identity name from key, version-less certificate, or certificate name.