Skip to content

Most visited

Recently visited

navigation
Added in API level 1

CertPathValidator

public class CertPathValidator
extends Object

java.lang.Object
   ↳ java.security.cert.CertPathValidator


This class provides the functionality for validating certification paths (certificate chains) establishing a trust chain from a certificate to a trust anchor.

Summary

Protected constructors

CertPathValidator(CertPathValidatorSpi validatorSpi, Provider provider, String algorithm)

Creates a new CertPathValidator instance.

Public methods

final String getAlgorithm()

Returns the certification path algorithm name.

final static String getDefaultType()

Returns the default CertPathValidator type from the Security Properties.

static CertPathValidator getInstance(String algorithm, String provider)

Returns a new certification path validator for the specified algorithm from the specified provider.

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)

Returns a new certification path validator for the specified algorithm.

final Provider getProvider()

Returns the security provider.

final CertPathValidatorResult validate(CertPath certPath, CertPathParameters params)

Validates the CertPath with the algorithm of this CertPathValidator using the specified algorithm parameters.

Inherited methods

From class java.lang.Object

Protected constructors

CertPathValidator

Added in API level 1
CertPathValidator (CertPathValidatorSpi validatorSpi, 
                Provider provider, 
                String algorithm)

Creates a new CertPathValidator instance.

Parameters
validatorSpi CertPathValidatorSpi: the implementation delegate.
provider Provider: the security provider.
algorithm String: the name of the algorithm.

Public methods

getAlgorithm

Added in API level 1
String getAlgorithm ()

Returns the certification path algorithm name.

Returns
String the certification path algorithm name.

getDefaultType

Added in API level 1
String getDefaultType ()

Returns the default CertPathValidator type from the Security Properties.

Returns
String the default CertPathValidator type from the Security Properties, or the string "PKIX" if it cannot be determined.

getInstance

Added in API level 1
CertPathValidator getInstance (String algorithm, 
                String provider)

Returns a new certification path validator for the specified algorithm from the specified provider.

Parameters
algorithm String: the algorithm name.
provider String: the security provider name.
Returns
CertPathValidator a certification path validator for the requested algorithm.
Throws
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()

getInstance

Added in API level 1
CertPathValidator getInstance (String algorithm, 
                Provider provider)

Returns a new certification path validator for the specified algorithm from the specified provider. The provider supplied does not have to be registered.

Parameters
algorithm String: the algorithm name.
provider Provider: the security provider name.
Returns
CertPathValidator a certification path validator for the requested algorithm.
Throws
NoSuchAlgorithmException if the specified provider cannot provide the requested algorithm.
IllegalArgumentException if provider == null
NullPointerException if algorithm is null.

getInstance

Added in API level 1
CertPathValidator getInstance (String algorithm)

Returns a new certification path validator for the specified algorithm.

Parameters
algorithm String: the algorithm name.
Returns
CertPathValidator a certification path validator for the requested algorithm.
Throws
NoSuchAlgorithmException if no installed provider provides the specified algorithm.
NullPointerException if algorithm is null.

getProvider

Added in API level 1
Provider getProvider ()

Returns the security provider.

Returns
Provider the provider.

validate

Added in API level 1
CertPathValidatorResult validate (CertPath certPath, 
                CertPathParameters params)

Validates the CertPath with the algorithm of this CertPathValidator using the specified algorithm parameters.

Parameters
certPath CertPath: the certification path to be validated.
params CertPathParameters: the certification path validator algorithm parameters.
Returns
CertPathValidatorResult the validation result.
Throws
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.

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.