Android APIs
public class

PKIXBuilderParameters

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

Class Overview

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.

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.
[Expand]
Inherited Methods
From class java.security.cert.PKIXParameters
From class java.lang.Object
From interface java.security.cert.CertPathParameters

Public Constructors

public PKIXBuilderParameters (Set<TrustAnchor> trustAnchors, CertSelector targetConstraints)

Added in API level 1

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

Parameters
trustAnchors the set of TrustAnchors.
targetConstraints 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.

public PKIXBuilderParameters (KeyStore keyStore, CertSelector targetConstraints)

Added in API level 1

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

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

Public Methods

public int getMaxPathLength ()

Added in API level 1

Returns the maximum length of a certification path.

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

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

public void setMaxPathLength (int maxPathLength)

Added in API level 1

Set the maximum length of a certification path.

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

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

public String toString ()

Added in API level 1

Returns a string representation of this PKIXBuilderParameters instance.

Returns
  • a string representation of this PKIXBuilderParameters instance.