23 #ifndef NDN_POLICY_MANAGER_HPP
24 #define NDN_POLICY_MANAGER_HPP
26 #include "../../data.hpp"
27 #include "../key-chain.hpp"
31 class ValidationRequest;
93 virtual ptr_lib::shared_ptr<ValidationRequest>
95 (
const ptr_lib::shared_ptr<Data>& data,
int stepCount,
const OnVerified& onVerified,
const OnVerifyFailed& onVerifyFailed) = 0;
115 virtual ptr_lib::shared_ptr<ValidationRequest>
117 (
const ptr_lib::shared_ptr<Interest>& interest,
int stepCount,
154 const Blob& publicKeyDer);
168 const Blob& publicKeyDer);
182 const Blob& publicKeyDer);
func_lib::function< void(const ptr_lib::shared_ptr< Interest > &interest)> OnVerifyInterestFailed
An OnVerifyInterestFailed function object is used to pass a callback to verifyInterest to report a fa...
Definition: validation-request.hpp:52
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
func_lib::function< void(const ptr_lib::shared_ptr< Interest > &interest)> OnVerifiedInterest
An OnVerifiedInterest function object is used to pass a callback to verifyInterest to report a succes...
Definition: validation-request.hpp:45
static bool verifySha256WithEcdsaSignature(const Blob &signature, const SignedBlob &signedBlob, const Blob &publicKeyDer)
Verify the ECDSA signature on the SignedBlob using the given public key.
static bool verifySignature(const Signature *signature, const SignedBlob &signedBlob, const Blob &publicKeyDer)
Check the type of signature and use the publicKeyDer to verify the signedBlob using the appropriate s...
Definition: policy-manager.cpp:39
func_lib::function< void(const ptr_lib::shared_ptr< Data > &data)> OnVerified
An OnVerified function object is used to pass a callback to verifyData to report a successful verific...
Definition: validation-request.hpp:33
static bool verifyDigestSha256Signature(const Blob &signature, const SignedBlob &signedBlob)
Verify the DigestSha256 signature on the SignedBlob by verifying that the digest of SignedBlob equals...
Definition: policy-manager.cpp:117
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A Signature is an abstract base class providing methods to work with the signature information in a D...
Definition: signature.hpp:35
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
static bool verifySha256WithRsaSignature(const Blob &signature, const SignedBlob &signedBlob, const Blob &publicKeyDer)
Verify the RSA signature on the SignedBlob using the given public key.
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:41
virtual Name inferSigningIdentity(const Name &dataName)=0
Infer the signing identity name according to the policy.
virtual ptr_lib::shared_ptr< ValidationRequest > checkVerificationPolicy(const ptr_lib::shared_ptr< Data > &data, int stepCount, const OnVerified &onVerified, const OnVerifyFailed &onVerifyFailed)=0
Check whether the received data packet complies with the verification policy, and get the indication ...
func_lib::function< void(const ptr_lib::shared_ptr< Data > &data)> OnVerifyFailed
An OnVerifyFailed function object is used to pass a callback to verifyData to report a failed verific...
Definition: validation-request.hpp:38
virtual ~PolicyManager()
The virtual destructor.
Definition: policy-manager.hpp:43
virtual bool checkSigningPolicy(const Name &dataName, const Name &certificateName)=0
Check if the signing certificate name and data name satisfy the signing policy.
virtual bool requireVerify(const Data &data)=0
Check if this PolicyManager has a verification rule for the received data.
A SignedBlob extends Blob to keep the offsets of a signed portion (e.g., the bytes of Data packet)...
Definition: signed-blob.hpp:34
virtual bool skipVerifyAndTrust(const Data &data)=0
Check if the received data packet can escape from verification and be trusted as valid.
A PolicyManager is an abstract base class to represent the policy for verifying data packets...
Definition: policy-manager.hpp:37