A PolicyManager is an abstract base class to represent the policy for verifying data packets.
More...
#include <policy-manager.hpp>
|
|
virtual | ~PolicyManager () |
| | The virtual destructor.
|
| |
| virtual bool | skipVerifyAndTrust (const Data &data)=0 |
| | Check if the received data packet can escape from verification and be trusted as valid. More...
|
| |
| virtual bool | skipVerifyAndTrust (const Interest &interest)=0 |
| | Check if the received signed interest can escape from verification and be trusted as valid. More...
|
| |
| virtual bool | requireVerify (const Data &data)=0 |
| | Check if this PolicyManager has a verification rule for the received data. More...
|
| |
| virtual bool | requireVerify (const Interest &interest)=0 |
| | Check if this PolicyManager has a verification rule for the received signed interest. More...
|
| |
virtual ptr_lib::shared_ptr
< ValidationRequest > | checkVerificationPolicy (const ptr_lib::shared_ptr< Data > &data, int stepCount, const OnVerified &onVerified, const OnDataValidationFailed &onValidationFailed)=0 |
| | Check whether the received data packet complies with the verification policy, and get the indication of the next verification step. More...
|
| |
virtual ptr_lib::shared_ptr
< ValidationRequest > | checkVerificationPolicy (const ptr_lib::shared_ptr< Interest > &interest, int stepCount, const OnVerifiedInterest &onVerified, const OnInterestValidationFailed &onValidationFailed, WireFormat &wireFormat)=0 |
| | Check whether the received signed interest complies with the verification policy, and get the indication of the next verification step. More...
|
| |
| virtual bool | checkSigningPolicy (const Name &dataName, const Name &certificateName)=0 |
| | Check if the signing certificate name and data name satisfy the signing policy. More...
|
| |
| virtual Name | inferSigningIdentity (const Name &dataName)=0 |
| | Infer the signing identity name according to the policy. More...
|
| |
|
| 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...
|
| |
A PolicyManager is an abstract base class to represent the policy for verifying data packets.
You must create an object of a subclass.
| virtual bool ndn::PolicyManager::checkSigningPolicy |
( |
const Name & |
dataName, |
|
|
const Name & |
certificateName |
|
) |
| |
|
pure virtual |
Check whether the received data packet complies with the verification policy, and get the indication of the next verification step.
- Parameters
-
| data | The Data object with the signature to check. |
| stepCount | The number of verification steps that have been done, used to track the verification progress. |
| onVerified | If 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. |
| onValidationFailed | If the signature check fails, this calls onValidationFailed(data, reason). 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
- the indication of next verification step, null if there is no further step.
Implemented in ndn::ConfigPolicyManager, ndn::SelfVerifyPolicyManager, and ndn::NoVerifyPolicyManager.
Check whether the received signed interest complies with the verification policy, and get the indication of the next verification step.
- Parameters
-
| interest | The interest with the signature to check. |
| stepCount | The number of verification steps that have been done, used to track the verification progress. |
| onVerified | If 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. |
| onValidationFailed | If the signature check fails, this calls onValidationFailed(interest, reason). 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
- the indication of next verification step, null if there is no further step.
Implemented in ndn::ConfigPolicyManager, ndn::SelfVerifyPolicyManager, and ndn::NoVerifyPolicyManager.
| virtual Name ndn::PolicyManager::inferSigningIdentity |
( |
const Name & |
dataName | ) |
|
|
pure virtual |
| virtual bool ndn::PolicyManager::requireVerify |
( |
const Data & |
data | ) |
|
|
pure virtual |
| virtual bool ndn::PolicyManager::requireVerify |
( |
const Interest & |
interest | ) |
|
|
pure virtual |
| virtual bool ndn::PolicyManager::skipVerifyAndTrust |
( |
const Data & |
data | ) |
|
|
pure virtual |
| virtual bool ndn::PolicyManager::skipVerifyAndTrust |
( |
const Interest & |
interest | ) |
|
|
pure virtual |
| bool ndn::PolicyManager::verifySignature |
( |
const Signature * |
signature, |
|
|
const SignedBlob & |
signedBlob, |
|
|
const Blob & |
publicKeyDer |
|
) |
| |
|
staticprotected |
Check the type of signature and use the publicKeyDer to verify the signedBlob using the appropriate signature algorithm.
- Parameters
-
| signature | An object of a subclass of Signature, e.g. Sha256WithRsaSignature. |
| signedBlob | the SignedBlob with the signed portion to verify. |
| publicKeyDer | The DER-encoded public key used to verify the signature. This may be null if the signature type does not require a public key. |
- Returns
- True if the signature is verified, false if failed.
- Exceptions
-
| SecurityException | if the signature type is not recognized or if publicKeyDer can't be decoded. |
The documentation for this class was generated from the following files: