This class uses a provider-based architecture.
To create a CertPathValidator,
call one of the static getInstance methods, passing in the
algorithm name of the CertPathValidator desired and
optionally the name of the provider desired.
Once a CertPathValidator object has been created, it can
be used to validate certification paths by calling the validate method and passing it the CertPath to be validated
and an algorithm-specific set of parameters. If successful, the result is
returned in an object that implements the
CertPathValidatorResult interface.
The getRevocationChecker method allows an application to specify
additional algorithm-specific parameters and options used by the
CertPathValidator when checking the revocation status of
certificates. Here is an example demonstrating how it is used with the PKIX
algorithm:
CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
PKIXRevocationChecker rc = (PKIXRevocationChecker)cpv.getRevocationChecker();
rc.setOptions(EnumSet.of(Option.SOFT_FAIL));
params.addCertPathChecker(rc);
CertPathValidatorResult cpvr = cpv.validate(path, params);
Every implementation of the Java platform is required to support the
following standard CertPathValidator algorithm:
PKIXConcurrent Access
The static methods of this class are guaranteed to be thread-safe. Multiple threads may concurrently invoke the static methods defined in this class with no ill effects.
However, this is not true for the non-static methods defined by this class.
Unless otherwise documented by a specific provider, threads that need to
access a single CertPathValidator instance concurrently should
synchronize amongst themselves and provide the necessary locking. Multiple
threads each manipulating a different CertPathValidator
instance need not synchronize.
CertPath
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private static final String | |
| private final Provider | |
| private final CertPathValidatorSpi |
| Access | Constructor and Description |
|---|---|
| protected | CertPathValidator(CertPathValidatorSpi
the provider implementation validatorSpi, Provider the provider provider, String the algorithm name algorithm)Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public final String | Returns: the algorithm name of thisCertPathValidatorReturns the algorithm name of this |
| public static final String | Returns: the defaultCertPathValidator type as specified
by the certpathvalidator.type security property, or the string
"PKIX" if no such property exists.Returns the default |
| public static CertPathValidator | Returns: aCertPathValidator object that implements the
specified algorithmthe name of the requested algorithm)CertPathValidator
algorithm. See the CertPathValidator section in the
Java Security Standard Algorithm Names Specification
for information about standard algorithm names.Returns a |
| public static CertPathValidator | Returns: aCertPathValidator object that implements the
specified algorithmthe name of the requested algorithm, String CertPathValidator
algorithm. See the CertPathValidator section in the
Java Security Standard Algorithm Names Specification
for information about standard algorithm names.the name of the provider. provider)Returns a |
| public static CertPathValidator | Returns: aCertPathValidator object that implements the
specified algorithmthe name of the requested algorithm, Provider CertPathValidator
algorithm. See the CertPathValidator section in the
Java Security Standard Algorithm Names Specification
for information about standard algorithm names.the provider. provider)Returns a |
| public final Provider | Returns: theProvider of this CertPathValidatorReturns the |
| public final CertPathChecker | Returns: aCertPathCheckerReturns a |
| public final CertPathValidatorResult | Returns: the result of the validation algorithmthe certPath, CertPathParameters CertPath to be validatedthe algorithm parameters params)Validates the specified certification path using the specified algorithm parameter set. |
| algorithm | back to summary |
|---|---|
| private final String algorithm | |
| CPV_TYPE | back to summary |
|---|---|
| private static final String CPV_TYPE | |
| provider | back to summary |
|---|---|
| private final Provider provider | |
| validatorSpi | back to summary |
|---|---|
| private final CertPathValidatorSpi validatorSpi | |
| CertPathValidator | back to summary |
|---|---|
| protected CertPathValidator(CertPathValidatorSpi validatorSpi, Provider provider, String algorithm) Creates a
| |
| getAlgorithm | back to summary |
|---|---|
| public final String getAlgorithm() Returns the algorithm name of this
| |
| getDefaultType | back to summary |
|---|---|
| public static final String getDefaultType() Returns the default The default The default
| |
| getInstance | back to summary |
|---|---|
| public static CertPathValidator getInstance(String algorithm) throws NoSuchAlgorithmException Returns a This method traverses the list of registered security Providers, starting with the most preferred Provider. A new CertPathValidator object encapsulating the CertPathValidatorSpi implementation from the first Provider that supports the specified algorithm is returned. Note that the list of registered providers may be retrieved via
the Implementation Note The JDK Reference Implementation additionally uses the
| |
| getInstance | back to summary |
|---|---|
| public static CertPathValidator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException Returns a A new CertPathValidator object encapsulating the CertPathValidatorSpi implementation from the specified provider is returned. The specified provider must be registered in the security provider list. Note that the list of registered providers may be retrieved via
the
| |
| getInstance | back to summary |
|---|---|
| public static CertPathValidator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException Returns a A new CertPathValidator object encapsulating the CertPathValidatorSpi implementation from the specified Provider object is returned. Note that the specified Provider object does not have to be registered in the provider list.
| |
| getProvider | back to summary |
|---|---|
| public final Provider getProvider() Returns the
| |
| getRevocationChecker | back to summary |
|---|---|
| public final CertPathChecker getRevocationChecker() Returns a The primary purpose of this method is to allow callers to specify additional input parameters and options specific to revocation checking. See the class description for an example.
| |
| validate | back to summary |
|---|---|
| public final CertPathValidatorResult validate(CertPath certPath, CertPathParameters params) throws CertPathValidatorException, InvalidAlgorithmParameterException Validates the specified certification path using the specified algorithm parameter set.
The
| |