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>
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.
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. |
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
-
dataName | The name of data to be signed. |
certificateName | The name of signing certificate. |
- Returns
- true to indicate that the signing certificate can be used to sign the data.
Implements ndn::PolicyManager.
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
-
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. (stepCount is ignored.) |
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. |
onVerifyFailed | If 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.
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
-
interest | The interest with the signature to check. |
stepCount | The number of verification steps that have been done, used to track the verification progress. (stepCount is ignored.) |
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. |
onVerifyFailed | If 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
-
dataName | The 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
-
data | The 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
-
interest | The received interest. |
- Returns
- true.
Implements ndn::PolicyManager.
bool ndn::SelfVerifyPolicyManager::skipVerifyAndTrust |
( |
const Data & |
data | ) |
|
|
virtual |
Never skip verification.
- Parameters
-
data | The received data packet. |
- Returns
- false.
Implements ndn::PolicyManager.
bool ndn::SelfVerifyPolicyManager::skipVerifyAndTrust |
( |
const Interest & |
interest | ) |
|
|
virtual |
Never skip verification.
- Parameters
-
interest | The received interest. |
- Returns
- false.
Implements ndn::PolicyManager.
The documentation for this class was generated from the following files: