net.named_data.jndn.security.policy
public class ConfigPolicyManager extends PolicyManager
| Modifier and Type | Class and Description |
|---|---|
static interface |
ConfigPolicyManager.Friend
A class implements Friend if it has a method
setConfigPolicyManagerFriendAccess which setFriendAccess calls to set
the FriendAccess object.
|
static class |
ConfigPolicyManager.FriendAccess
A friend class can call the methods of FriendAccess to access private
methods.
|
| Constructor and Description |
|---|
ConfigPolicyManager(String configFileName) |
ConfigPolicyManager(String configFileName,
CertificateCache certificateCache) |
ConfigPolicyManager(String configFileName,
CertificateCache certificateCache,
int searchDepth) |
ConfigPolicyManager(String configFileName,
CertificateCache certificateCache,
int searchDepth,
double graceInterval) |
ConfigPolicyManager(String configFileName,
CertificateCache certificateCache,
int searchDepth,
double graceInterval,
double keyTimestampTtl) |
ConfigPolicyManager(String configFileName,
CertificateCache certificateCache,
int searchDepth,
double graceInterval,
double keyTimestampTtl,
int maxTrackedKeys)
Create a new ConfigPolicyManager which acts on the rules specified in the
configuration file and downloads unknown certificates when necessary.
|
| 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)
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,
OnVerifyInterestFailed onVerifyFailed,
WireFormat wireFormat)
Check whether the received signed interest complies with the verification
policy, and get the indication of the next verification step.
|
Name |
inferSigningIdentity(Name dataName)
Infer the signing identity name according to the policy.
|
boolean |
requireVerify(Data data)
Check if this PolicyManager has a verification rule for the received data.
|
boolean |
requireVerify(Interest interest)
Check if this PolicyManager has a verification rule for the received signed
interest.
|
static void |
setFriendAccess(ConfigPolicyManager.Friend friend)
Call friend.setConfigPolicyManagerFriendAccess to pass an instance of
a FriendAccess class to allow a friend class to call private methods.
|
boolean |
skipVerifyAndTrust(Data data)
Check if the received data packet can escape from verification and be
trusted as valid.
|
boolean |
skipVerifyAndTrust(Interest interest)
Check if the received signed interest can escape from verification and be
trusted as valid.
|
checkVerificationPolicy, verifyDigestSha256Signature, verifySha256WithEcdsaSignature, verifySha256WithRsaSignature, verifySignaturepublic ConfigPolicyManager(String configFileName, CertificateCache certificateCache, int searchDepth, double graceInterval, double keyTimestampTtl, int maxTrackedKeys) throws IOException, SecurityException
configFileName - The path to the configuration file containing
verification rules.certificateCache - (optional) A CertificateCache to hold known
certificates. If this is null or omitted, then create an internal
CertificateCache.searchDepth - (optional) The maximum number of links to follow when
verifying a certificate chain.graceInterval - (optional) The window of time difference (in milliseconds)
allowed between the timestamp of the first interest signed with a new
public key and the validation time. If omitted, use a default value.keyTimestampTtl - (optional) How long a public key's last-used
timestamp is kept in the store (milliseconds). If omitted, use a default
value.maxTrackedKeys - The maximum number of public key use timestamps to
track.IOExceptionSecurityExceptionpublic ConfigPolicyManager(String configFileName, CertificateCache certificateCache, int searchDepth, double graceInterval, double keyTimestampTtl) throws IOException, SecurityException
IOExceptionSecurityExceptionpublic ConfigPolicyManager(String configFileName, CertificateCache certificateCache, int searchDepth, double graceInterval) throws IOException, SecurityException
IOExceptionSecurityExceptionpublic ConfigPolicyManager(String configFileName, CertificateCache certificateCache, int searchDepth) throws IOException, SecurityException
IOExceptionSecurityExceptionpublic ConfigPolicyManager(String configFileName, CertificateCache certificateCache) throws IOException, SecurityException
IOExceptionSecurityExceptionpublic ConfigPolicyManager(String configFileName) throws IOException, SecurityException
IOExceptionSecurityExceptionpublic final boolean skipVerifyAndTrust(Data data)
skipVerifyAndTrust in class PolicyManagerdata - The received data packet.public final boolean skipVerifyAndTrust(Interest interest)
skipVerifyAndTrust in class PolicyManagerinterest - The received interest.public final boolean requireVerify(Data data)
requireVerify in class PolicyManagerdata - The received data packet.public final boolean requireVerify(Interest interest)
requireVerify in class PolicyManagerinterest - The received interest.public final ValidationRequest checkVerificationPolicy(Data data, int stepCount, OnVerified onVerified, OnVerifyFailed onVerifyFailed) 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.onVerified - If the signature is verified, this calls
onVerified.onVerified(data).onVerifyFailed - If the signature check fails, this calls
onVerifyFailed.onVerifyFailed(data).SecurityExceptionpublic final ValidationRequest checkVerificationPolicy(Interest interest, int stepCount, OnVerifiedInterest onVerified, OnVerifyInterestFailed onVerifyFailed, 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.onVerified - If the signature is verified, this calls onVerified(interest).onVerifyFailed - If the signature check fails, this calls
onVerifyFailed(interest).SecurityExceptionpublic final boolean checkSigningPolicy(Name dataName, Name certificateName)
checkSigningPolicy in class PolicyManagerdataName - The name of data to be signed.certificateName - The name of signing certificate.public final Name inferSigningIdentity(Name dataName)
inferSigningIdentity in class PolicyManagerdataName - The name of data to be signed.public static void setFriendAccess(ConfigPolicyManager.Friend friend)
friend - The friend class for calling setConfigPolicyManagerFriendAccess.
This uses friend.getClass() to make sure that it is a friend class.
Therefore, only a friend class gets an implementation of FriendAccess.Copyright © 2015. All rights reserved.