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,
OnVerifyFailed onVerifyFailed)
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,
OnVerifyInterestFailed onVerifyFailed,
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, verifySignature
public 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 PolicyManager
data
- The received data packet.public boolean skipVerifyAndTrust(Interest interest)
skipVerifyAndTrust
in class PolicyManager
interest
- The received interest.public boolean requireVerify(Data data)
requireVerify
in class PolicyManager
data
- The received data packet.public boolean requireVerify(Interest interest)
requireVerify
in class PolicyManager
interest
- The received interest.public ValidationRequest checkVerificationPolicy(Data data, int stepCount, OnVerified onVerified, OnVerifyFailed onVerifyFailed) throws SecurityException
checkVerificationPolicy
in class PolicyManager
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.SecurityException
public ValidationRequest checkVerificationPolicy(Interest interest, int stepCount, OnVerifiedInterest onVerified, OnVerifyInterestFailed onVerifyFailed, WireFormat wireFormat) throws SecurityException
checkVerificationPolicy
in class PolicyManager
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.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.onVerifyFailed
- If the signature check fails or can't find the public
key, this calls onVerifyFailed.onVerifyInterestFailed(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.SecurityException
public boolean checkSigningPolicy(Name dataName, Name certificateName)
checkSigningPolicy
in class PolicyManager
dataName
- The name of data to be signed.certificateName
- The name of signing certificate.public Name inferSigningIdentity(Name dataName)
inferSigningIdentity
in class PolicyManager
dataName
- The name of data to be signed.Copyright © 2016. All rights reserved.