public abstract class PolicyManager extends Object
| Constructor and Description |
|---|
PolicyManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
checkSigningPolicy(Name dataName,
Name certificateName)
Check if the signing certificate name and data name satisfy the signing
policy.
|
abstract ValidationRequest |
checkVerificationPolicy(Data data,
int stepCount,
OnVerified onVerified,
OnDataValidationFailed onValidationFailed)
Check whether the received data packet complies with the verification
policy, and get the indication of the next verification step.
|
ValidationRequest |
checkVerificationPolicy(Interest interest,
int stepCount,
OnVerifiedInterest onVerified,
OnInterestValidationFailed onValidationFailed) |
abstract ValidationRequest |
checkVerificationPolicy(Interest interest,
int stepCount,
OnVerifiedInterest onVerified,
OnInterestValidationFailed onValidationFailed,
WireFormat wireFormat)
Check whether the received signed interest complies with the verification
policy, and get the indication of the next verification step.
|
abstract Name |
inferSigningIdentity(Name dataName)
Infer the signing identity name according to the policy.
|
abstract boolean |
requireVerify(Data data)
Check if this PolicyManager has a verification rule for the received data.
|
abstract boolean |
requireVerify(Interest interest)
Check if this PolicyManager has a verification rule for the received interest.
|
abstract boolean |
skipVerifyAndTrust(Data data)
Check if the received data packet can escape from verification and be
trusted as valid.
|
abstract boolean |
skipVerifyAndTrust(Interest interest)
Check if the received signed interest can escape from verification and be
trusted as valid.
|
protected static boolean |
verifySignature(Signature signature,
SignedBlob signedBlob,
Blob publicKeyDer)
Check the type of signature and use the publicKeyDer to verify the
signedBlob using the appropriate signature algorithm.
|
public abstract boolean skipVerifyAndTrust(Data data)
data - The received data packet.public abstract boolean skipVerifyAndTrust(Interest interest)
interest - The received interest.public abstract boolean requireVerify(Data data)
data - The received data packet.public abstract boolean requireVerify(Interest interest)
interest - The received interest.public abstract ValidationRequest checkVerificationPolicy(Data data, int stepCount, OnVerified onVerified, OnDataValidationFailed onValidationFailed) throws SecurityException
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.onDataValidationFailed(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.SecurityExceptionpublic abstract ValidationRequest checkVerificationPolicy(Interest interest, int stepCount, OnVerifiedInterest onVerified, OnInterestValidationFailed onValidationFailed, WireFormat wireFormat) throws SecurityException
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.onVerifiedInterest(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.onInterestValidationFailed(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.SecurityExceptionpublic ValidationRequest checkVerificationPolicy(Interest interest, int stepCount, OnVerifiedInterest onVerified, OnInterestValidationFailed onValidationFailed) throws SecurityException
SecurityExceptionpublic abstract boolean checkSigningPolicy(Name dataName, Name certificateName)
dataName - The name of data to be signed.certificateName - The name of signing certificate.public abstract Name inferSigningIdentity(Name dataName)
dataName - The name of data to be signed.protected static boolean verifySignature(Signature signature, SignedBlob signedBlob, Blob publicKeyDer) throws SecurityException
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.SecurityException - if the signature type is not recognized or if
publicKeyDer can't be decoded.Copyright © 2019. All rights reserved.