Public Member Functions | List of all members
ndn::SelfVerifyPolicyManager Class Reference

A SelfVerifyPolicyManager implements a PolicyManager to look in the IdentityStorage for the public key with the name in the KeyLocator (if available) and use it to verify the data packet, without searching a certificate chain. More...

#include <self-verify-policy-manager.hpp>

Inheritance diagram for ndn::SelfVerifyPolicyManager:
ndn::PolicyManager

Public Member Functions

 SelfVerifyPolicyManager (IdentityStorage *identityStorage=0)
 Create a new SelfVerifyPolicyManager which will look up the public key in the given identityStorage. More...
 
virtual ~SelfVerifyPolicyManager ()
 The virtual destructor.
 
virtual bool skipVerifyAndTrust (const Data &data)
 Never skip verification. More...
 
virtual bool skipVerifyAndTrust (const Interest &interest)
 Never skip verification. More...
 
virtual bool requireVerify (const Data &data)
 Always return true to use the self-verification rule for the received data. More...
 
virtual bool requireVerify (const Interest &interest)
 Always return true to use the self-verification rule for the received signed interest. More...
 
virtual ptr_lib::shared_ptr< ValidationRequestcheckVerificationPolicy (const ptr_lib::shared_ptr< Data > &data, int stepCount, const OnVerified &onVerified, const OnVerifyFailed &onVerifyFailed)
 Look in the IdentityStorage for the public key with the name in the KeyLocator (if available) and use it to verify the data packet. More...
 
virtual ptr_lib::shared_ptr< ValidationRequestcheckVerificationPolicy (const ptr_lib::shared_ptr< Interest > &interest, int stepCount, const OnVerifiedInterest &onVerified, const OnVerifyInterestFailed &onVerifyFailed, WireFormat &wireFormat)
 Use wireFormat.decodeSignatureInfoAndValue to decode the last two name components of the signed interest. More...
 
virtual bool checkSigningPolicy (const Name &dataName, const Name &certificateName)
 Override to always indicate that the signing certificate name and data name satisfy the signing policy. More...
 
virtual Name inferSigningIdentity (const Name &dataName)
 Override to indicate that the signing identity cannot be inferred. More...
 
- Public Member Functions inherited from ndn::PolicyManager
virtual ~PolicyManager ()
 The virtual destructor.
 

Additional Inherited Members

- Static Protected Member Functions inherited from ndn::PolicyManager
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 signature algorithm. More...
 
static bool verifySha256WithEcdsaSignature (const Blob &signature, const SignedBlob &signedBlob, const Blob &publicKeyDer)
 Verify the ECDSA signature on the SignedBlob using the given public key. More...
 
static bool verifySha256WithRsaSignature (const Blob &signature, const SignedBlob &signedBlob, const Blob &publicKeyDer)
 Verify the RSA signature on the SignedBlob using the given public key. More...
 
static bool verifyDigestSha256Signature (const Blob &signature, const SignedBlob &signedBlob)
 Verify the DigestSha256 signature on the SignedBlob by verifying that the digest of SignedBlob equals the signature. More...
 

Detailed Description

A SelfVerifyPolicyManager implements a PolicyManager to look in the IdentityStorage for the public key with the name in the KeyLocator (if available) and use it to verify the data packet, without searching a certificate chain.

If the public key can't be found, the verification fails.

Constructor & Destructor Documentation

ndn::SelfVerifyPolicyManager::SelfVerifyPolicyManager ( IdentityStorage identityStorage = 0)
inline

Create a new SelfVerifyPolicyManager which will look up the public key in the given identityStorage.

Parameters
identityStorage(optional) The IdentityStorage for looking up the public key. This points to an object which must remain valid during the life of this SelfVerifyPolicyManager. If omitted, then don't look for a public key with the name in the KeyLocator.

Member Function Documentation

bool ndn::SelfVerifyPolicyManager::checkSigningPolicy ( const Name dataName,
const Name certificateName 
)
virtual

Override to always indicate that the signing certificate name and data name satisfy the signing policy.

Parameters
dataNameThe name of data to be signed.
certificateNameThe name of signing certificate.
Returns
true to indicate that the signing certificate can be used to sign the data.

Implements ndn::PolicyManager.

ptr_lib::shared_ptr< ValidationRequest > ndn::SelfVerifyPolicyManager::checkVerificationPolicy ( const ptr_lib::shared_ptr< Data > &  data,
int  stepCount,
const OnVerified onVerified,
const OnVerifyFailed onVerifyFailed 
)
virtual

Look in the IdentityStorage for the public key with the name in the KeyLocator (if available) and use it to verify the data packet.

If the public key can't be found, call onVerifyFailed.

Parameters
dataThe Data object with the signature to check.
stepCountThe number of verification steps that have been done, used to track the verification progress. (stepCount is ignored.)
onVerifiedIf the signature is verified, this calls onVerified(data). NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.
onVerifyFailedIf the signature check fails or can't find the public key, this calls onVerifyFailed(data). NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.
Returns
null for no further step for looking up a certificate chain.

Implements ndn::PolicyManager.

ptr_lib::shared_ptr< ValidationRequest > ndn::SelfVerifyPolicyManager::checkVerificationPolicy ( const ptr_lib::shared_ptr< Interest > &  interest,
int  stepCount,
const OnVerifiedInterest onVerified,
const OnVerifyInterestFailed onVerifyFailed,
WireFormat wireFormat 
)
virtual

Use wireFormat.decodeSignatureInfoAndValue to decode the last two name components of the signed interest.

Look in the IdentityStorage for the public key with the name in the KeyLocator (if available) and use it to verify the interest. If the public key can't be found, call onVerifyFailed.

Parameters
interestThe interest with the signature to check.
stepCountThe number of verification steps that have been done, used to track the verification progress. (stepCount is ignored.)
onVerifiedIf the signature is verified, this calls onVerified(interest). NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.
onVerifyFailedIf the signature check fails or can't find the public key, this calls onVerifyFailed(interest). NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.
Returns
null for no further step for looking up a certificate chain.

Implements ndn::PolicyManager.

Name ndn::SelfVerifyPolicyManager::inferSigningIdentity ( const Name dataName)
virtual

Override to indicate that the signing identity cannot be inferred.

Parameters
dataNameThe name of data to be signed.
Returns
An empty name because cannot infer.

Implements ndn::PolicyManager.

bool ndn::SelfVerifyPolicyManager::requireVerify ( const Data data)
virtual

Always return true to use the self-verification rule for the received data.

Parameters
dataThe received data packet.
Returns
true.

Implements ndn::PolicyManager.

bool ndn::SelfVerifyPolicyManager::requireVerify ( const Interest interest)
virtual

Always return true to use the self-verification rule for the received signed interest.

Parameters
interestThe received interest.
Returns
true.

Implements ndn::PolicyManager.

bool ndn::SelfVerifyPolicyManager::skipVerifyAndTrust ( const Data data)
virtual

Never skip verification.

Parameters
dataThe received data packet.
Returns
false.

Implements ndn::PolicyManager.

bool ndn::SelfVerifyPolicyManager::skipVerifyAndTrust ( const Interest interest)
virtual

Never skip verification.

Parameters
interestThe received interest.
Returns
false.

Implements ndn::PolicyManager.


The documentation for this class was generated from the following files: