public class ExtensionTester
extends java.lang.Object
ExtensionTester validates all certificate extensions in a
certificate chain that were not validated while the chain was being built.
CertTestlet and register it using addTestlet.CertTestlet| Constructor and Description |
|---|
ExtensionTester(ValidationInfo validationInfo)
Creates a new
ExtensionTester instance and initializes it
with the specified validation info. |
| Modifier and Type | Method and Description |
|---|---|
void |
addTestlet(CertTestlet testlet,
ObjectID extension)
Adds an extension testlet to be evaluated for each certificate when a
certificate chain is validated.
|
void |
addTestlet(CRLEntryTestlet testlet,
ObjectID extension)
Adds an extension testlet to be evaluated for each CRL entry when it is
validated.
|
void |
addTestlet(CRLTestlet testlet,
ObjectID extension)
Adds an extension testlet to be evaluated for each CRL when it is
validated.
|
void |
addTestlet(ExtensionTestlet testlet,
ObjectID extensionOID)
Adds an extension testlet.
|
void |
validate(X509Certificate[] chain)
Validates the certificate extensions in each certificate of the chain.
|
void |
validate(X509Certificate target,
X509Certificate[] chain)
Validates the certificate extensions in each certificate of the chain.
|
void |
validate(X509CRL crl,
X509Certificate caCert)
Validates the CRL extensions and CRL entry extensions in the CRL.
|
public ExtensionTester(ValidationInfo validationInfo)
ExtensionTester instance and initializes it
with the specified validation info.
validationInfo - the validation information that will be used during extension testingjava.lang.NullPointerException - thrown if validationInfo is nullpublic void addTestlet(CertTestlet testlet, ObjectID extension)
If a testlet already exists for the given ObjectID, this testlet, as the most recent to be registered, will be used to test the certificate extension.
testlet - the new testlet to be registeredextension - the object ID of the extension that testlet
validatespublic void addTestlet(CRLTestlet testlet, ObjectID extension)
If a testlet already exists for the given ObjectID, this testlet, as the most recent to be registered, will be used to test the CRL extension.
testlet - the new testlet to be registeredextension - the object ID of the extension that testlet
validatespublic void addTestlet(CRLEntryTestlet testlet, ObjectID extension)
If a testlet already exists for the given ObjectID, this testlet, as the most recent to be registered, will be used to test the CRL entry extension.
testlet - the new testlet to be registeredextension - the object ID of the extension that testlet
validatespublic void addTestlet(ExtensionTestlet testlet, ObjectID extensionOID)
There are different categories of extension testlest, each of which is used to test extensions from different sources:
If an extension testlet has already been added for the provided object ID, the provided testlet will replace the existing testlet, and be used during validation.
testlet - the new testlet to be registeredextensionOID - the object ID of the extension that this testlet will validatepublic void validate(X509Certificate[] chain) throws ExtensionException
chain - the certificate chaincom.entrust.toolkit.exceptions.UnknownExtensionException - thrown if a certificate in the chain contains an unknown critical
extensionExtensionException - thrown if chain validation failspublic void validate(X509Certificate target, X509Certificate[] chain) throws ExtensionException
target - The certificate that is the eventual target of the validation.
Whether or not the target is included in the chain can change
the validity of the chain under special cirumstances.chain - the certificate chaincom.entrust.toolkit.exceptions.UnknownExtensionException - thrown if a certificate in the chain contains an unknown critical
extensionExtensionException - thrown if chain validation failspublic void validate(X509CRL crl, X509Certificate caCert) throws ExtensionException
crl - the CRLcom.entrust.toolkit.exceptions.UnknownExtensionException - thrown if the CRL or a CRL entry contains an unknown critical
extensionExtensionException - thrown if CRL validation fails