public class CertPathValidator extends Object
Modifier | Constructor and Description |
---|---|
protected |
CertPathValidator(CertPathValidatorSpi validatorSpi,
Provider provider,
String algorithm)
Creates a new
CertPathValidator instance. |
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
Returns the certification path algorithm name.
|
static String |
getDefaultType()
Returns the default
CertPathValidator type from the Security
Properties. |
static CertPathValidator |
getInstance(String algorithm)
Returns a new certification path validator for the specified algorithm.
|
static CertPathValidator |
getInstance(String algorithm,
Provider provider)
Returns a new certification path validator for the specified algorithm
from the specified provider.
|
static CertPathValidator |
getInstance(String algorithm,
String provider)
Returns a new certification path validator for the specified algorithm
from the specified provider.
|
Provider |
getProvider()
Returns the security provider.
|
CertPathValidatorResult |
validate(CertPath certPath,
CertPathParameters params)
Validates the
CertPath with the algorithm of this CertPathValidator using the specified algorithm parameters. |
protected CertPathValidator(CertPathValidatorSpi validatorSpi, Provider provider, String algorithm)
CertPathValidator
instance.validatorSpi
- the implementation delegate.provider
- the security provider.algorithm
- the name of the algorithm.public final String getAlgorithm()
public final Provider getProvider()
public static CertPathValidator getInstance(String algorithm) throws NoSuchAlgorithmException
algorithm
- the algorithm name.NoSuchAlgorithmException
- if no installed provider provides the specified algorithm.NullPointerException
- if algorithm is null
.public static CertPathValidator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
algorithm
- the algorithm name.provider
- the security provider name.NoSuchAlgorithmException
- if the specified security provider cannot provide the
requested algorithm.NoSuchProviderException
- if no provider with the specified name can be found.NullPointerException
- if algorithm is null
.IllegalArgumentException
- if provider == null || provider.isEmpty()
public static CertPathValidator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException
algorithm
- the algorithm name.provider
- the security provider name.NoSuchAlgorithmException
- if the specified provider cannot provide the requested
algorithm.IllegalArgumentException
- if provider == null
NullPointerException
- if algorithm is null
.public final CertPathValidatorResult validate(CertPath certPath, CertPathParameters params) throws CertPathValidatorException, InvalidAlgorithmParameterException
CertPath
with the algorithm of this CertPathValidator
using the specified algorithm parameters.certPath
- the certification path to be validated.params
- the certification path validator algorithm parameters.CertPathValidatorException
- if the validation fails, or the algorithm of the specified
certification path cannot be validated using the algorithm of
this instance.InvalidAlgorithmParameterException
- if the specified algorithm parameters cannot be used with
this algorithm.CertPathValidatorResult
public static final String getDefaultType()
CertPathValidator
type from the Security
Properties.CertPathValidator
type from the Security
Properties, or the string "PKIX"
if it cannot be
determined.