A SelfVerifyPolicyManager implements a PolicyManager to use the public key DER in the data packet's KeyLocator (if available) or 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 use the public key DER in the data packet's KeyLocator (if available) or 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 and rely on the KeyLocator having the full public key DER. |
| 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.
Use the public key DER in the data packet's KeyLocator (if available) or 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). |
| onVerifyFailed | If the signature check fails or can't find the public key, this calls onVerifyFailed(data). |
- 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.
Use the public key DER in the signed interest SignatureInfo's KeyLocator (if available) or 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). |
| onVerifyFailed | If the signature check fails or can't find the public key, this calls onVerifyFailed(interest). |
- 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: