public class Validator extends CertificateStorage
trustAnchors_, unverifiedCertificateCache_, verifiedCertificateCache_| Constructor and Description |
|---|
Validator(ValidationPolicy policy)
Create a Validator with the policy.
|
Validator(ValidationPolicy policy,
CertificateFetcher certificateFetcher)
Create a Validator with the policy and fetcher.
|
| Modifier and Type | Method and Description |
|---|---|
CertificateFetcher |
getFetcher()
Get the CertificateFetcher given to (or created in) the constructor.
|
int |
getMaxDepth()
Get the maximum depth of the certificate chain.
|
ValidationPolicy |
getPolicy()
Get the ValidationPolicy given to the constructor.
|
void |
setMaxDepth(int maxDepth)
Set the maximum depth of the certificate chain.
|
void |
validate(Data data,
DataValidationSuccessCallback successCallback,
DataValidationFailureCallback failureCallback)
Asynchronously validate the Data packet.
|
void |
validate(Interest interest,
InterestValidationSuccessCallback successCallback,
InterestValidationFailureCallback failureCallback)
Asynchronously validate the Interest.
|
cacheUnverifiedCertificate, cacheVerifiedCertificate, findTrustedCertificate, getTrustAnchors, getUnverifiedCertificateCache, getVerifiedCertificateCache, isCertificateKnown, loadAnchor, loadAnchor, loadAnchor, resetAnchors, resetVerifiedCertificates, setCacheNowOffsetMilliseconds_public Validator(ValidationPolicy policy, CertificateFetcher certificateFetcher)
policy - The validation policy to be associated with this validator.certificateFetcher - The certificate fetcher implementation.public Validator(ValidationPolicy policy)
policy - The validation policy to be associated with this validator.public final ValidationPolicy getPolicy()
public final CertificateFetcher getFetcher()
public final void setMaxDepth(int maxDepth)
maxDepth - The maximum depth.public final int getMaxDepth()
public final void validate(Data data, DataValidationSuccessCallback successCallback, DataValidationFailureCallback failureCallback) throws CertificateV2.Error, ValidatorConfigError
data - The Data packet to validate, which is copied.successCallback - On validation success, this calls
successCallback.successCallback(data).failureCallback - On validation failure, this calls
failureCallback.failureCallback(data, error) where error is a
ValidationError.CertificateV2.ErrorValidatorConfigErrorpublic final void validate(Interest interest, InterestValidationSuccessCallback successCallback, InterestValidationFailureCallback failureCallback) throws CertificateV2.Error, ValidatorConfigError
interest - The Interest to validate, which is copied.successCallback - On validation success, this calls
successCallback.successCallback(interest).failureCallback - On validation failure, this calls
failureCallback.failureCallback(interest, error) where error is a
ValidationError.CertificateV2.ErrorValidatorConfigErrorCopyright © 2019. All rights reserved.