java.security.cert
Class PKIXBuilderParameters

java.lang.Object
  extended by java.security.cert.PKIXParameters
      extended by java.security.cert.PKIXBuilderParameters
All Implemented Interfaces:
Cloneable, CertPathParameters

public class PKIXBuilderParameters
extends PKIXParameters

Parameters for building certificate paths using the PKIX algorithm.

Since:
1.4
See Also:
CertPathBuilder

Constructor Summary
PKIXBuilderParameters(KeyStore keystore, CertSelector targetConstraints)
          Create a new PKIXBuilderParameters object, populating the trusted certificates set with all X.509 certificates found in the given key store.
PKIXBuilderParameters(Set<TrustAnchor> trustAnchors, CertSelector targetConstraints)
          Create a new PKIXBuilderParameters object, populating the trusted certificates set with the elements of the given set, each of which must be a TrustAnchor.
 
Method Summary
 int getMaxPathLength()
          Returns the maximum length of certificate paths to build.
 void setMaxPathLength(int maxPathLength)
          Sets the maximum length of certificate paths to build.
 String toString()
          Returns a printable representation of these parameters.
 
Methods inherited from class java.security.cert.PKIXParameters
addCertPathChecker, addCertStore, clone, getCertPathCheckers, getCertStores, getDate, getInitialPolicies, getPolicyQualifiersRejected, getSigProvider, getTargetCertConstraints, getTrustAnchors, isAnyPolicyInhibited, isExplicitPolicyRequired, isPolicyMappingInhibited, isRevocationEnabled, setAnyPolicyInhibited, setCertPathCheckers, setCertStores, setDate, setExplicitPolicyRequired, setInitialPolicies, setPolicyMappingInhibited, setPolicyQualifiersRejected, setRevocationEnabled, setSigProvider, setTargetCertConstraints, setTrustAnchors
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PKIXBuilderParameters

public PKIXBuilderParameters(KeyStore keystore,
                             CertSelector targetConstraints)
                      throws KeyStoreException,
                             InvalidAlgorithmParameterException
Create a new PKIXBuilderParameters object, populating the trusted certificates set with all X.509 certificates found in the given key store. All certificates found in the key store are assumed to be trusted by this constructor.

Parameters:
keystore - The key store.
targetConstraints - The target certificate constraints.
Throws:
KeyStoreException - If the certificates cannot be retrieved from the key store.
InvalidAlgorithmParameterException - If there are no certificates in the key store.
NullPointerException - If keystore is null.

PKIXBuilderParameters

public PKIXBuilderParameters(Set<TrustAnchor> trustAnchors,
                             CertSelector targetConstraints)
                      throws InvalidAlgorithmParameterException
Create a new PKIXBuilderParameters object, populating the trusted certificates set with the elements of the given set, each of which must be a TrustAnchor.

Parameters:
trustAnchors - The set of trust anchors.
targetConstraints - The target certificate constraints.
Throws:
InvalidAlgorithmParameterException - If there are no certificates in the set.
NullPointerException - If trustAnchors is null.
ClassCastException - If every element in trustAnchors is not a TrustAnchor.
Method Detail

getMaxPathLength

public int getMaxPathLength()
Returns the maximum length of certificate paths to build.

If this value is 0 it is taken to mean that the certificate path should contain only one certificate. A value of -1 means that the certificate path length is unconstrained. The default value is 5.

Returns:
The maximum path length.

setMaxPathLength

public void setMaxPathLength(int maxPathLength)
Sets the maximum length of certificate paths to build.

Parameters:
maxPathLength - The new path length.
Throws:
IllegalArgumentException - If maxPathLength is less than -1.

toString

public String toString()
Description copied from class: PKIXParameters
Returns a printable representation of these parameters.

Overrides:
toString in class PKIXParameters
Returns:
A printable representation of these parameters.
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)