Skip to content

Most visited

Recently visited

navigation
Added in API level 1

PKIXBuilderParameters

public class PKIXBuilderParameters
extends PKIXParameters

java.lang.Object
   ↳ java.security.cert.PKIXParameters
     ↳ java.security.cert.PKIXBuilderParameters


The parameter specification for a PKIX CertPathBuilder algorithm used to build certificate chains validated with the PKIX certification path validation.

The parameters must be created with trusted certificate authorities and constraints for the target certificates.

See also:

Summary

Public constructors

PKIXBuilderParameters(Set<TrustAnchor> trustAnchors, CertSelector targetConstraints)

Creates a new PKIXBuilderParameters instance with the specified set of TrustAnchor and certificate constraints.

PKIXBuilderParameters(KeyStore keyStore, CertSelector targetConstraints)

Creates a new PKIXBuilderParameters instance with the trusted X509Certificate entries from the specified KeyStore.

Public methods

int getMaxPathLength()

Returns the maximum length of a certification path.

void setMaxPathLength(int maxPathLength)

Set the maximum length of a certification path.

String toString()

Returns a string representation of this PKIXBuilderParameters instance.

Inherited methods

From class java.security.cert.PKIXParameters
From class java.lang.Object
From interface java.security.cert.CertPathParameters

Public constructors

PKIXBuilderParameters

Added in API level 1
PKIXBuilderParameters (Set<TrustAnchor> trustAnchors, 
                CertSelector targetConstraints)

Creates a new PKIXBuilderParameters instance with the specified set of TrustAnchor and certificate constraints.

Parameters
trustAnchors Set: the set of TrustAnchors.
targetConstraints CertSelector: the certificate constraints.
Throws
InvalidAlgorithmParameterException if trustAnchors is empty.
ClassCastException if one of the items in trustAnchors is not an instance of java.security.cert.TrustAnchor.

PKIXBuilderParameters

Added in API level 1
PKIXBuilderParameters (KeyStore keyStore, 
                CertSelector targetConstraints)

Creates a new PKIXBuilderParameters instance with the trusted X509Certificate entries from the specified KeyStore.

Parameters
keyStore KeyStore: the key store containing trusted certificates.
targetConstraints CertSelector: the certificate constraints.
Throws
KeyStoreException if the keyStore is not initialized.
InvalidAlgorithmParameterException if keyStore does not contained any trusted certificate entry.

Public methods

getMaxPathLength

Added in API level 1
int getMaxPathLength ()

Returns the maximum length of a certification path.

This is the maximum number of non-self-signed certificates in a certification path.

Returns
int the maximum length of a certification path, or -1 if it is unlimited.

setMaxPathLength

Added in API level 1
void setMaxPathLength (int maxPathLength)

Set the maximum length of a certification path.

This is the maximum number of non-self-signed certificates in a certification path.

Parameters
maxPathLength int: the maximum length of a certification path.
Throws
InvalidParameterException if maxPathLength is less than -1.

toString

Added in API level 1
String toString ()

Returns a string representation of this PKIXBuilderParameters instance.

Returns
String a string representation of this PKIXBuilderParameters instance.
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.