net.named_data.jndn.security.policy
public class SelfVerifyPolicyManager extends PolicyManager
| Constructor and Description |
|---|
SelfVerifyPolicyManager()
Create a new SelfVerifyPolicyManager which will look up the public key in
the given identityStorage.
|
SelfVerifyPolicyManager(IdentityStorage identityStorage)
Create a new SelfVerifyPolicyManager which will look up the public key in
the given identityStorage.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkSigningPolicy(Name dataName,
Name certificateName)
Override to always indicate that the signing certificate name and data name
satisfy the signing policy.
|
ValidationRequest |
checkVerificationPolicy(Data data,
int stepCount,
OnVerified onVerified,
OnDataValidationFailed onValidationFailed)
Look in the IdentityStorage for the public key with the name in the
KeyLocator (if available) and use it to verify the data packet.
|
ValidationRequest |
checkVerificationPolicy(Interest interest,
int stepCount,
OnVerifiedInterest onVerified,
OnInterestValidationFailed onValidationFailed,
WireFormat wireFormat)
Use wireFormat.decodeSignatureInfoAndValue to decode the last two name
components of the signed interest.
|
Name |
inferSigningIdentity(Name dataName)
Override to indicate that the signing identity cannot be inferred.
|
boolean |
requireVerify(Data data)
Always return true to use the self-verification rule for the received data.
|
boolean |
requireVerify(Interest interest)
Always return true to use the self-verification rule for the received interest.
|
boolean |
skipVerifyAndTrust(Data data)
Never skip verification.
|
boolean |
skipVerifyAndTrust(Interest interest)
Never skip verification.
|
checkVerificationPolicy, verifyDigestSha256Signature, verifySha256WithEcdsaSignature, verifySha256WithRsaSignature, verifySignaturepublic SelfVerifyPolicyManager(IdentityStorage identityStorage)
identityStorage - The IdentityStorage for looking up the
public key. This points to an object which must remain valid during the
life of this SelfVerifyPolicyManager.public SelfVerifyPolicyManager()
public boolean skipVerifyAndTrust(Data data)
skipVerifyAndTrust in class PolicyManagerdata - The received data packet.public boolean skipVerifyAndTrust(Interest interest)
skipVerifyAndTrust in class PolicyManagerinterest - The received interest.public boolean requireVerify(Data data)
requireVerify in class PolicyManagerdata - The received data packet.public boolean requireVerify(Interest interest)
requireVerify in class PolicyManagerinterest - The received interest.public ValidationRequest checkVerificationPolicy(Data data, int stepCount, OnVerified onVerified, OnDataValidationFailed onValidationFailed) throws SecurityException
checkVerificationPolicy in class PolicyManagerdata - 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.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 ValidationRequest checkVerificationPolicy(Interest interest, int stepCount, OnVerifiedInterest onVerified, OnInterestValidationFailed onValidationFailed, WireFormat wireFormat) throws SecurityException
checkVerificationPolicy in class PolicyManagerinterest - 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.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 or can't find the
public key, 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 boolean checkSigningPolicy(Name dataName, Name certificateName)
checkSigningPolicy in class PolicyManagerdataName - The name of data to be signed.certificateName - The name of signing certificate.public Name inferSigningIdentity(Name dataName)
inferSigningIdentity in class PolicyManagerdataName - The name of data to be signed.Copyright © 2016. All rights reserved.