java.security.cert
Class PKIXParameters

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.cert.PKIXParameters
All Implemented Interfaces:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , CertPathParameters sample code for java.security.cert.CertPathParameters definition code for java.security.cert.CertPathParameters
Direct Known Subclasses:
PKIXBuilderParameters sample code for java.security.cert.PKIXBuilderParameters definition code for java.security.cert.PKIXBuilderParameters

public class PKIXParameters
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements CertPathParameters sample code for java.security.cert.CertPathParameters definition code for java.security.cert.CertPathParameters

Parameters used as input for the PKIX CertPathValidator algorithm.

A PKIX CertPathValidator uses these parameters to validate a CertPath according to the PKIX certification path validation algorithm.

To instantiate a PKIXParameters object, an application must specify one or more most-trusted CAs as defined by the PKIX certification path validation algorithm. The most-trusted CAs can be specified using one of two constructors. An application can call PKIXParameters(Set) sample code for java.security.cert.PKIXParameters.PKIXParameters(java.util.Set) definition code for java.security.cert.PKIXParameters.PKIXParameters(java.util.Set) , specifying a Set of TrustAnchor objects, each of which identify a most-trusted CA. Alternatively, an application can call PKIXParameters(KeyStore) sample code for java.security.cert.PKIXParameters.PKIXParameters(java.security.KeyStore) definition code for java.security.cert.PKIXParameters.PKIXParameters(java.security.KeyStore) , specifying a KeyStore instance containing trusted certificate entries, each of which will be considered as a most-trusted CA.

Once a PKIXParameters object has been created, other parameters can be specified (by calling setInitialPolicies sample code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set) definition code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set) or setDate sample code for java.security.cert.PKIXParameters.setDate(java.util.Date) definition code for java.security.cert.PKIXParameters.setDate(java.util.Date) , for instance) and then the PKIXParameters is passed along with the CertPath to be validated to CertPathValidator.validate sample code for java.security.cert.CertPathValidator.validate(java.security.cert.CertPath, java.security.cert.CertPathParameters) definition code for java.security.cert.CertPathValidator.validate(java.security.cert.CertPath, java.security.cert.CertPathParameters) .

Any parameter that is not set (or is set to null) will be set to the default value for that parameter. The default value for the date parameter is null, which indicates the current time when the path is validated. The default for the remaining parameters is the least constrained.

Concurrent Access

Unless otherwise specified, the methods defined in this class are not thread-safe. Multiple threads that need to access a single object concurrently should synchronize amongst themselves and provide the necessary locking. Multiple threads each manipulating separate objects need not synchronize.

Since:
1.4
See Also:
CertPathValidator sample code for java.security.cert.CertPathValidator definition code for java.security.cert.CertPathValidator

Constructor Summary
PKIXParameters sample code for java.security.cert.PKIXParameters.PKIXParameters(java.security.KeyStore) definition code for java.security.cert.PKIXParameters.PKIXParameters(java.security.KeyStore) (KeyStore sample code for java.security.KeyStore definition code for java.security.KeyStore  keystore)
          Creates an instance of PKIXParameters that populates the set of most-trusted CAs from the trusted certificate entries contained in the specified KeyStore.
PKIXParameters sample code for java.security.cert.PKIXParameters.PKIXParameters(java.util.Set) definition code for java.security.cert.PKIXParameters.PKIXParameters(java.util.Set) (Set sample code for java.util.Set definition code for java.util.Set <TrustAnchor sample code for java.security.cert.TrustAnchor definition code for java.security.cert.TrustAnchor > trustAnchors)
          Creates an instance of PKIXParameters with the specified Set of most-trusted CAs.
 
Method Summary
 void addCertPathChecker sample code for java.security.cert.PKIXParameters.addCertPathChecker(java.security.cert.PKIXCertPathChecker) definition code for java.security.cert.PKIXParameters.addCertPathChecker(java.security.cert.PKIXCertPathChecker) (PKIXCertPathChecker sample code for java.security.cert.PKIXCertPathChecker definition code for java.security.cert.PKIXCertPathChecker  checker)
          Adds a PKIXCertPathChecker to the list of certification path checkers.
 void addCertStore sample code for java.security.cert.PKIXParameters.addCertStore(java.security.cert.CertStore) definition code for java.security.cert.PKIXParameters.addCertStore(java.security.cert.CertStore) (CertStore sample code for java.security.cert.CertStore definition code for java.security.cert.CertStore  store)
          Adds a CertStore to the end of the list of CertStores used in finding certificates and CRLs.
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.security.cert.PKIXParameters.clone() definition code for java.security.cert.PKIXParameters.clone() ()
          Makes a copy of this PKIXParameters object.
 List sample code for java.util.List definition code for java.util.List <PKIXCertPathChecker sample code for java.security.cert.PKIXCertPathChecker definition code for java.security.cert.PKIXCertPathChecker > getCertPathCheckers sample code for java.security.cert.PKIXParameters.getCertPathCheckers() definition code for java.security.cert.PKIXParameters.getCertPathCheckers() ()
          Returns the List of certification path checkers.
 List sample code for java.util.List definition code for java.util.List <CertStore sample code for java.security.cert.CertStore definition code for java.security.cert.CertStore > getCertStores sample code for java.security.cert.PKIXParameters.getCertStores() definition code for java.security.cert.PKIXParameters.getCertStores() ()
          Returns an immutable List of CertStores that are used to find certificates and CRLs.
 Date sample code for java.util.Date definition code for java.util.Date getDate sample code for java.security.cert.PKIXParameters.getDate() definition code for java.security.cert.PKIXParameters.getDate() ()
          Returns the time for which the validity of the certification path should be determined.
 Set sample code for java.util.Set definition code for java.util.Set <String sample code for java.lang.String definition code for java.lang.String > getInitialPolicies sample code for java.security.cert.PKIXParameters.getInitialPolicies() definition code for java.security.cert.PKIXParameters.getInitialPolicies() ()
          Returns an immutable Set of initial policy identifiers (OID strings), indicating that any one of these policies would be acceptable to the certificate user for the purposes of certification path processing.
 boolean getPolicyQualifiersRejected sample code for java.security.cert.PKIXParameters.getPolicyQualifiersRejected() definition code for java.security.cert.PKIXParameters.getPolicyQualifiersRejected() ()
          Gets the PolicyQualifiersRejected flag.
 String sample code for java.lang.String definition code for java.lang.String getSigProvider sample code for java.security.cert.PKIXParameters.getSigProvider() definition code for java.security.cert.PKIXParameters.getSigProvider() ()
          Returns the signature provider's name, or null if not set.
 CertSelector sample code for java.security.cert.CertSelector definition code for java.security.cert.CertSelector getTargetCertConstraints sample code for java.security.cert.PKIXParameters.getTargetCertConstraints() definition code for java.security.cert.PKIXParameters.getTargetCertConstraints() ()
          Returns the required constraints on the target certificate.
 Set sample code for java.util.Set definition code for java.util.Set <TrustAnchor sample code for java.security.cert.TrustAnchor definition code for java.security.cert.TrustAnchor > getTrustAnchors sample code for java.security.cert.PKIXParameters.getTrustAnchors() definition code for java.security.cert.PKIXParameters.getTrustAnchors() ()
          Returns an immutable Set of the most-trusted CAs.
 boolean isAnyPolicyInhibited sample code for java.security.cert.PKIXParameters.isAnyPolicyInhibited() definition code for java.security.cert.PKIXParameters.isAnyPolicyInhibited() ()
          Checks whether the any policy OID should be processed if it is included in a certificate.
 boolean isExplicitPolicyRequired sample code for java.security.cert.PKIXParameters.isExplicitPolicyRequired() definition code for java.security.cert.PKIXParameters.isExplicitPolicyRequired() ()
          Checks if explicit policy is required.
 boolean isPolicyMappingInhibited sample code for java.security.cert.PKIXParameters.isPolicyMappingInhibited() definition code for java.security.cert.PKIXParameters.isPolicyMappingInhibited() ()
          Checks if policy mapping is inhibited.
 boolean isRevocationEnabled sample code for java.security.cert.PKIXParameters.isRevocationEnabled() definition code for java.security.cert.PKIXParameters.isRevocationEnabled() ()
          Checks the RevocationEnabled flag.
 void setAnyPolicyInhibited sample code for java.security.cert.PKIXParameters.setAnyPolicyInhibited(boolean) definition code for java.security.cert.PKIXParameters.setAnyPolicyInhibited(boolean) (boolean val)
          Sets state to determine if the any policy OID should be processed if it is included in a certificate.
 void setCertPathCheckers sample code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List) definition code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List) (List sample code for java.util.List definition code for java.util.List <PKIXCertPathChecker sample code for java.security.cert.PKIXCertPathChecker definition code for java.security.cert.PKIXCertPathChecker > checkers)
          Sets a List of additional certification path checkers.
 void setCertStores sample code for java.security.cert.PKIXParameters.setCertStores(java.util.List) definition code for java.security.cert.PKIXParameters.setCertStores(java.util.List) (List sample code for java.util.List definition code for java.util.List <CertStore sample code for java.security.cert.CertStore definition code for java.security.cert.CertStore > stores)
          Sets the list of CertStores to be used in finding certificates and CRLs.
 void setDate sample code for java.security.cert.PKIXParameters.setDate(java.util.Date) definition code for java.security.cert.PKIXParameters.setDate(java.util.Date) (Date sample code for java.util.Date definition code for java.util.Date  date)
          Sets the time for which the validity of the certification path should be determined.
 void setExplicitPolicyRequired sample code for java.security.cert.PKIXParameters.setExplicitPolicyRequired(boolean) definition code for java.security.cert.PKIXParameters.setExplicitPolicyRequired(boolean) (boolean val)
          Sets the ExplicitPolicyRequired flag.
 void setInitialPolicies sample code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set) definition code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set) (Set sample code for java.util.Set definition code for java.util.Set <String sample code for java.lang.String definition code for java.lang.String > initialPolicies)
          Sets the Set of initial policy identifiers (OID strings), indicating that any one of these policies would be acceptable to the certificate user for the purposes of certification path processing.
 void setPolicyMappingInhibited sample code for java.security.cert.PKIXParameters.setPolicyMappingInhibited(boolean) definition code for java.security.cert.PKIXParameters.setPolicyMappingInhibited(boolean) (boolean val)
          Sets the PolicyMappingInhibited flag.
 void setPolicyQualifiersRejected sample code for java.security.cert.PKIXParameters.setPolicyQualifiersRejected(boolean) definition code for java.security.cert.PKIXParameters.setPolicyQualifiersRejected(boolean) (boolean qualifiersRejected)
          Sets the PolicyQualifiersRejected flag.
 void setRevocationEnabled sample code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean) definition code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean) (boolean val)
          Sets the RevocationEnabled flag.
 void setSigProvider sample code for java.security.cert.PKIXParameters.setSigProvider(java.lang.String) definition code for java.security.cert.PKIXParameters.setSigProvider(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  sigProvider)
          Sets the signature provider's name.
 void setTargetCertConstraints sample code for java.security.cert.PKIXParameters.setTargetCertConstraints(java.security.cert.CertSelector) definition code for java.security.cert.PKIXParameters.setTargetCertConstraints(java.security.cert.CertSelector) (CertSelector sample code for java.security.cert.CertSelector definition code for java.security.cert.CertSelector  selector)
          Sets the required constraints on the target certificate.
 void setTrustAnchors sample code for java.security.cert.PKIXParameters.setTrustAnchors(java.util.Set) definition code for java.security.cert.PKIXParameters.setTrustAnchors(java.util.Set) (Set sample code for java.util.Set definition code for java.util.Set <TrustAnchor sample code for java.security.cert.TrustAnchor definition code for java.security.cert.TrustAnchor > trustAnchors)
          Sets the Set of most-trusted CAs.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.security.cert.PKIXParameters.toString() definition code for java.security.cert.PKIXParameters.toString() ()
          Returns a formatted string describing the parameters.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

PKIXParameters sample code for java.security.cert.PKIXParameters(java.util.Set<java.security.cert.TrustAnchor>) definition code for java.security.cert.PKIXParameters(java.util.Set<java.security.cert.TrustAnchor>)

public PKIXParameters(Set sample code for java.util.Set definition code for java.util.Set <TrustAnchor sample code for java.security.cert.TrustAnchor definition code for java.security.cert.TrustAnchor > trustAnchors)
               throws InvalidAlgorithmParameterException sample code for java.security.InvalidAlgorithmParameterException definition code for java.security.InvalidAlgorithmParameterException 
Creates an instance of PKIXParameters with the specified Set of most-trusted CAs. Each element of the set is a TrustAnchor sample code for java.security.cert.TrustAnchor definition code for java.security.cert.TrustAnchor .

Note that the Set is copied to protect against subsequent modifications.

Parameters:
trustAnchors - a Set of TrustAnchors
Throws:
InvalidAlgorithmParameterException sample code for java.security.InvalidAlgorithmParameterException definition code for java.security.InvalidAlgorithmParameterException - if the specified Set is empty (trustAnchors.isEmpty() == true)
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the specified Set is null
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if any of the elements in the Set are not of type java.security.cert.TrustAnchor

PKIXParameters sample code for java.security.cert.PKIXParameters(java.security.KeyStore) definition code for java.security.cert.PKIXParameters(java.security.KeyStore)

public PKIXParameters(KeyStore sample code for java.security.KeyStore definition code for java.security.KeyStore  keystore)
               throws KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException ,
                      InvalidAlgorithmParameterException sample code for java.security.InvalidAlgorithmParameterException definition code for java.security.InvalidAlgorithmParameterException 
Creates an instance of PKIXParameters that populates the set of most-trusted CAs from the trusted certificate entries contained in the specified KeyStore. Only keystore entries that contain trusted X509Certificates are considered; all other certificate types are ignored.

Parameters:
keystore - a KeyStore from which the set of most-trusted CAs will be populated
Throws:
KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException - if the keystore has not been initialized
InvalidAlgorithmParameterException sample code for java.security.InvalidAlgorithmParameterException definition code for java.security.InvalidAlgorithmParameterException - if the keystore does not contain at least one trusted certificate entry
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the keystore is null
Method Detail

getTrustAnchors sample code for java.security.cert.PKIXParameters.getTrustAnchors() definition code for java.security.cert.PKIXParameters.getTrustAnchors()

public Set sample code for java.util.Set definition code for java.util.Set <TrustAnchor sample code for java.security.cert.TrustAnchor definition code for java.security.cert.TrustAnchor > getTrustAnchors()
Returns an immutable Set of the most-trusted CAs.

Returns:
an immutable Set of TrustAnchors (never null)
See Also:
setTrustAnchors(java.util.Set) sample code for java.security.cert.PKIXParameters.setTrustAnchors(java.util.Set) definition code for java.security.cert.PKIXParameters.setTrustAnchors(java.util.Set)

setTrustAnchors sample code for java.security.cert.PKIXParameters.setTrustAnchors(java.util.Set<java.security.cert.TrustAnchor>) definition code for java.security.cert.PKIXParameters.setTrustAnchors(java.util.Set<java.security.cert.TrustAnchor>)

public void setTrustAnchors(Set sample code for java.util.Set definition code for java.util.Set <TrustAnchor sample code for java.security.cert.TrustAnchor definition code for java.security.cert.TrustAnchor > trustAnchors)
                     throws InvalidAlgorithmParameterException sample code for java.security.InvalidAlgorithmParameterException definition code for java.security.InvalidAlgorithmParameterException 
Sets the Set of most-trusted CAs.

Note that the Set is copied to protect against subsequent modifications.

Parameters:
trustAnchors - a Set of TrustAnchors
Throws:
InvalidAlgorithmParameterException sample code for java.security.InvalidAlgorithmParameterException definition code for java.security.InvalidAlgorithmParameterException - if the specified Set is empty (trustAnchors.isEmpty() == true)
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the specified Set is null
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if any of the elements in the set are not of type java.security.cert.TrustAnchor
See Also:
getTrustAnchors() sample code for java.security.cert.PKIXParameters.getTrustAnchors() definition code for java.security.cert.PKIXParameters.getTrustAnchors()

getInitialPolicies sample code for java.security.cert.PKIXParameters.getInitialPolicies() definition code for java.security.cert.PKIXParameters.getInitialPolicies()

public Set sample code for java.util.Set definition code for java.util.Set <String sample code for java.lang.String definition code for java.lang.String > getInitialPolicies()
Returns an immutable Set of initial policy identifiers (OID strings), indicating that any one of these policies would be acceptable to the certificate user for the purposes of certification path processing. The default return value is an empty Set, which is interpreted as meaning that any policy would be acceptable.

Returns:
an immutable Set of initial policy OIDs in String format, or an empty Set (implying any policy is acceptable). Never returns null.
See Also:
setInitialPolicies(java.util.Set) sample code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set) definition code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set)

setInitialPolicies sample code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set<java.lang.String>) definition code for java.security.cert.PKIXParameters.setInitialPolicies(java.util.Set<java.lang.String>)

public void setInitialPolicies(Set sample code for java.util.Set definition code for java.util.Set <String sample code for java.lang.String definition code for java.lang.String > initialPolicies)
Sets the Set of initial policy identifiers (OID strings), indicating that any one of these policies would be acceptable to the certificate user for the purposes of certification path processing. By default, any policy is acceptable (i.e. all policies), so a user that wants to allow any policy as acceptable does not need to call this method, or can call it with an empty Set (or null).

Note that the Set is copied to protect against subsequent modifications.

Parameters:
initialPolicies - a Set of initial policy OIDs in String format (or null)
Throws:
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if any of the elements in the set are not of type String
See Also:
getInitialPolicies() sample code for java.security.cert.PKIXParameters.getInitialPolicies() definition code for java.security.cert.PKIXParameters.getInitialPolicies()

setCertStores sample code for java.security.cert.PKIXParameters.setCertStores(java.util.List<java.security.cert.CertStore>) definition code for java.security.cert.PKIXParameters.setCertStores(java.util.List<java.security.cert.CertStore>)

public void setCertStores(List sample code for java.util.List definition code for java.util.List <CertStore sample code for java.security.cert.CertStore definition code for java.security.cert.CertStore > stores)
Sets the list of CertStores to be used in finding certificates and CRLs. May be null, in which case no CertStores will be used. The first CertStores in the list may be preferred to those that appear later.

Note that the List is copied to protect against subsequent modifications.

Parameters:
stores - a List of CertStores (or null)
Throws:
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if any of the elements in the list are not of type java.security.cert.CertStore
See Also:
getCertStores() sample code for java.security.cert.PKIXParameters.getCertStores() definition code for java.security.cert.PKIXParameters.getCertStores()

addCertStore sample code for java.security.cert.PKIXParameters.addCertStore(java.security.cert.CertStore) definition code for java.security.cert.PKIXParameters.addCertStore(java.security.cert.CertStore)

public void addCertStore(CertStore sample code for java.security.cert.CertStore definition code for java.security.cert.CertStore  store)
Adds a CertStore to the end of the list of CertStores used in finding certificates and CRLs.

Parameters:
store - the CertStore to add. If null, the store is ignored (not added to list).

getCertStores sample code for java.security.cert.PKIXParameters.getCertStores() definition code for java.security.cert.PKIXParameters.getCertStores()

public List sample code for java.util.List definition code for java.util.List <CertStore sample code for java.security.cert.CertStore definition code for java.security.cert.CertStore > getCertStores()
Returns an immutable List of CertStores that are used to find certificates and CRLs.

Returns:
an immutable List of CertStores (may be empty, but never null)
See Also:
setCertStores(java.util.List) sample code for java.security.cert.PKIXParameters.setCertStores(java.util.List) definition code for java.security.cert.PKIXParameters.setCertStores(java.util.List)

setRevocationEnabled sample code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean) definition code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean)

public void setRevocationEnabled(boolean val)
Sets the RevocationEnabled flag. If this flag is true, the default revocation checking mechanism of the underlying PKIX service provider will be used. If this flag is false, the default revocation checking mechanism will be disabled (not used).

When a PKIXParameters object is created, this flag is set to true. This setting reflects the most common strategy for checking revocation, since each service provider must support revocation checking to be PKIX compliant. Sophisticated applications should set this flag to false when it is not practical to use a PKIX service provider's default revocation checking mechanism or when an alternative revocation checking mechanism is to be substituted (by also calling the addCertPathChecker sample code for java.security.cert.PKIXParameters.addCertPathChecker(java.security.cert.PKIXCertPathChecker) definition code for java.security.cert.PKIXParameters.addCertPathChecker(java.security.cert.PKIXCertPathChecker) or setCertPathCheckers sample code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List) definition code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List) methods).

Parameters:
val - the new value of the RevocationEnabled flag

isRevocationEnabled sample code for java.security.cert.PKIXParameters.isRevocationEnabled() definition code for java.security.cert.PKIXParameters.isRevocationEnabled()

public boolean isRevocationEnabled()
Checks the RevocationEnabled flag. If this flag is true, the default revocation checking mechanism of the underlying PKIX service provider will be used. If this flag is false, the default revocation checking mechanism will be disabled (not used). See the setRevocationEnabled sample code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean) definition code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean) method for more details on setting the value of this flag.

Returns:
the current value of the RevocationEnabled flag

setExplicitPolicyRequired sample code for java.security.cert.PKIXParameters.setExplicitPolicyRequired(boolean) definition code for java.security.cert.PKIXParameters.setExplicitPolicyRequired(boolean)

public void setExplicitPolicyRequired(boolean val)
Sets the ExplicitPolicyRequired flag. If this flag is true, an acceptable policy needs to be explicitly identified in every certificate. By default, the ExplicitPolicyRequired flag is false.

Parameters:
val - true if explicit policy is to be required, false otherwise

isExplicitPolicyRequired sample code for java.security.cert.PKIXParameters.isExplicitPolicyRequired() definition code for java.security.cert.PKIXParameters.isExplicitPolicyRequired()

public boolean isExplicitPolicyRequired()
Checks if explicit policy is required. If this flag is true, an acceptable policy needs to be explicitly identified in every certificate. By default, the ExplicitPolicyRequired flag is false.

Returns:
true if explicit policy is required, false otherwise

setPolicyMappingInhibited sample code for java.security.cert.PKIXParameters.setPolicyMappingInhibited(boolean) definition code for java.security.cert.PKIXParameters.setPolicyMappingInhibited(boolean)

public void setPolicyMappingInhibited(boolean val)
Sets the PolicyMappingInhibited flag. If this flag is true, policy mapping is inhibited. By default, policy mapping is not inhibited (the flag is false).

Parameters:
val - true if policy mapping is to be inhibited, false otherwise

isPolicyMappingInhibited sample code for java.security.cert.PKIXParameters.isPolicyMappingInhibited() definition code for java.security.cert.PKIXParameters.isPolicyMappingInhibited()

public boolean isPolicyMappingInhibited()
Checks if policy mapping is inhibited. If this flag is true, policy mapping is inhibited. By default, policy mapping is not inhibited (the flag is false).

Returns:
true if policy mapping is inhibited, false otherwise

setAnyPolicyInhibited sample code for java.security.cert.PKIXParameters.setAnyPolicyInhibited(boolean) definition code for java.security.cert.PKIXParameters.setAnyPolicyInhibited(boolean)

public void setAnyPolicyInhibited(boolean val)
Sets state to determine if the any policy OID should be processed if it is included in a certificate. By default, the any policy OID is not inhibited (isAnyPolicyInhibited() sample code for java.security.cert.PKIXParameters.isAnyPolicyInhibited() definition code for java.security.cert.PKIXParameters.isAnyPolicyInhibited() returns false).

Parameters:
val - true if the any policy OID is to be inhibited, false otherwise

isAnyPolicyInhibited sample code for java.security.cert.PKIXParameters.isAnyPolicyInhibited() definition code for java.security.cert.PKIXParameters.isAnyPolicyInhibited()

public boolean isAnyPolicyInhibited()
Checks whether the any policy OID should be processed if it is included in a certificate.

Returns:
true if the any policy OID is inhibited, false otherwise

setPolicyQualifiersRejected sample code for java.security.cert.PKIXParameters.setPolicyQualifiersRejected(boolean) definition code for java.security.cert.PKIXParameters.setPolicyQualifiersRejected(boolean)

public void setPolicyQualifiersRejected(boolean qualifiersRejected)
Sets the PolicyQualifiersRejected flag. If this flag is true, certificates that include policy qualifiers in a certificate policies extension that is marked critical are rejected. If the flag is false, certificates are not rejected on this basis.

When a PKIXParameters object is created, this flag is set to true. This setting reflects the most common (and simplest) strategy for processing policy qualifiers. Applications that want to use a more sophisticated policy must set this flag to false.

Note that the PKIX certification path validation algorithm specifies that any policy qualifier in a certificate policies extension that is marked critical must be processed and validated. Otherwise the certification path must be rejected. If the policyQualifiersRejected flag is set to false, it is up to the application to validate all policy qualifiers in this manner in order to be PKIX compliant.

Parameters:
qualifiersRejected - the new value of the PolicyQualifiersRejected flag
See Also:
getPolicyQualifiersRejected() sample code for java.security.cert.PKIXParameters.getPolicyQualifiersRejected() definition code for java.security.cert.PKIXParameters.getPolicyQualifiersRejected() , PolicyQualifierInfo sample code for java.security.cert.PolicyQualifierInfo definition code for java.security.cert.PolicyQualifierInfo

getPolicyQualifiersRejected sample code for java.security.cert.PKIXParameters.getPolicyQualifiersRejected() definition code for java.security.cert.PKIXParameters.getPolicyQualifiersRejected()

public boolean getPolicyQualifiersRejected()
Gets the PolicyQualifiersRejected flag. If this flag is true, certificates that include policy qualifiers in a certificate policies extension that is marked critical are rejected. If the flag is false, certificates are not rejected on this basis.

When a PKIXParameters object is created, this flag is set to true. This setting reflects the most common (and simplest) strategy for processing policy qualifiers. Applications that want to use a more sophisticated policy must set this flag to false.

Returns:
the current value of the PolicyQualifiersRejected flag
See Also:
setPolicyQualifiersRejected(boolean) sample code for java.security.cert.PKIXParameters.setPolicyQualifiersRejected(boolean) definition code for java.security.cert.PKIXParameters.setPolicyQualifiersRejected(boolean)

getDate sample code for java.security.cert.PKIXParameters.getDate() definition code for java.security.cert.PKIXParameters.getDate()

public Date sample code for java.util.Date definition code for java.util.Date  getDate()
Returns the time for which the validity of the certification path should be determined. If null, the current time is used.

Note that the Date returned is copied to protect against subsequent modifications.

Returns:
the Date, or null if not set
See Also:
setDate(java.util.Date) sample code for java.security.cert.PKIXParameters.setDate(java.util.Date) definition code for java.security.cert.PKIXParameters.setDate(java.util.Date)

setDate sample code for java.security.cert.PKIXParameters.setDate(java.util.Date) definition code for java.security.cert.PKIXParameters.setDate(java.util.Date)

public void setDate(Date sample code for java.util.Date definition code for java.util.Date  date)
Sets the time for which the validity of the certification path should be determined. If null, the current time is used.

Note that the Date supplied here is copied to protect against subsequent modifications.

Parameters:
date - the Date, or null for the current time
See Also:
getDate() sample code for java.security.cert.PKIXParameters.getDate() definition code for java.security.cert.PKIXParameters.getDate()

setCertPathCheckers sample code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List<java.security.cert.PKIXCertPathChecker>) definition code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List<java.security.cert.PKIXCertPathChecker>)

public void setCertPathCheckers(List sample code for java.util.List definition code for java.util.List <PKIXCertPathChecker sample code for java.security.cert.PKIXCertPathChecker definition code for java.security.cert.PKIXCertPathChecker > checkers)
Sets a List of additional certification path checkers. If the specified List contains an object that is not a PKIXCertPathChecker, it is ignored.

Each PKIXCertPathChecker specified implements additional checks on a certificate. Typically, these are checks to process and verify private extensions contained in certificates. Each PKIXCertPathChecker should be instantiated with any initialization parameters needed to execute the check.

This method allows sophisticated applications to extend a PKIX CertPathValidator or CertPathBuilder. Each of the specified PKIXCertPathCheckers will be called, in turn, by a PKIX CertPathValidator or CertPathBuilder for each certificate processed or validated.

Regardless of whether these additional PKIXCertPathCheckers are set, a PKIX CertPathValidator or CertPathBuilder must perform all of the required PKIX checks on each certificate. The one exception to this rule is if the RevocationEnabled flag is set to false (see the setRevocationEnabled sample code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean) definition code for java.security.cert.PKIXParameters.setRevocationEnabled(boolean) method).

Note that the List supplied here is copied and each PKIXCertPathChecker in the list is cloned to protect against subsequent modifications.

Parameters:
checkers - a List of PKIXCertPathCheckers. May be null, in which case no additional checkers will be used.
Throws:
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if any of the elements in the list are not of type java.security.cert.PKIXCertPathChecker
See Also:
getCertPathCheckers() sample code for java.security.cert.PKIXParameters.getCertPathCheckers() definition code for java.security.cert.PKIXParameters.getCertPathCheckers()

getCertPathCheckers sample code for java.security.cert.PKIXParameters.getCertPathCheckers() definition code for java.security.cert.PKIXParameters.getCertPathCheckers()

public List sample code for java.util.List definition code for java.util.List <PKIXCertPathChecker sample code for java.security.cert.PKIXCertPathChecker definition code for java.security.cert.PKIXCertPathChecker > getCertPathCheckers()
Returns the List of certification path checkers. The returned List is immutable, and each PKIXCertPathChecker in the List is cloned to protect against subsequent modifications.

Returns:
an immutable List of PKIXCertPathCheckers (may be empty, but not null)
See Also:
setCertPathCheckers(java.util.List) sample code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List) definition code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List)

addCertPathChecker sample code for java.security.cert.PKIXParameters.addCertPathChecker(java.security.cert.PKIXCertPathChecker) definition code for java.security.cert.PKIXParameters.addCertPathChecker(java.security.cert.PKIXCertPathChecker)

public void addCertPathChecker(PKIXCertPathChecker sample code for java.security.cert.PKIXCertPathChecker definition code for java.security.cert.PKIXCertPathChecker  checker)
Adds a PKIXCertPathChecker to the list of certification path checkers. See the setCertPathCheckers sample code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List) definition code for java.security.cert.PKIXParameters.setCertPathCheckers(java.util.List) method for more details.

Note that the PKIXCertPathChecker is cloned to protect against subsequent modifications.

Parameters:
checker - a PKIXCertPathChecker to add to the list of checks. If null, the checker is ignored (not added to list).

getSigProvider sample code for java.security.cert.PKIXParameters.getSigProvider() definition code for java.security.cert.PKIXParameters.getSigProvider()

public String sample code for java.lang.String definition code for java.lang.String  getSigProvider()
Returns the signature provider's name, or null if not set.

Returns:
the signature provider's name (or null)
See Also:
setSigProvider(java.lang.String) sample code for java.security.cert.PKIXParameters.setSigProvider(java.lang.String) definition code for java.security.cert.PKIXParameters.setSigProvider(java.lang.String)

setSigProvider sample code for java.security.cert.PKIXParameters.setSigProvider(java.lang.String) definition code for java.security.cert.PKIXParameters.setSigProvider(java.lang.String)

public void setSigProvider(String sample code for java.lang.String definition code for java.lang.String  sigProvider)
Sets the signature provider's name. The specified provider will be preferred when creating Signature sample code for java.security.Signature definition code for java.security.Signature objects. If null or not set, the first provider found supporting the algorithm will be used.

Parameters:
sigProvider - the signature provider's name (or null)
See Also:
getSigProvider() sample code for java.security.cert.PKIXParameters.getSigProvider() definition code for java.security.cert.PKIXParameters.getSigProvider()

getTargetCertConstraints sample code for java.security.cert.PKIXParameters.getTargetCertConstraints() definition code for java.security.cert.PKIXParameters.getTargetCertConstraints()

public CertSelector sample code for java.security.cert.CertSelector definition code for java.security.cert.CertSelector  getTargetCertConstraints()
Returns the required constraints on the target certificate. The constraints are returned as an instance of CertSelector. If null, no constraints are defined.

Note that the CertSelector returned is cloned to protect against subsequent modifications.

Returns:
a CertSelector specifying the constraints on the target certificate (or null)
See Also:
setTargetCertConstraints(java.security.cert.CertSelector) sample code for java.security.cert.PKIXParameters.setTargetCertConstraints(java.security.cert.CertSelector) definition code for java.security.cert.PKIXParameters.setTargetCertConstraints(java.security.cert.CertSelector)

setTargetCertConstraints sample code for java.security.cert.PKIXParameters.setTargetCertConstraints(java.security.cert.CertSelector) definition code for java.security.cert.PKIXParameters.setTargetCertConstraints(java.security.cert.CertSelector)

public void setTargetCertConstraints(CertSelector sample code for java.security.cert.CertSelector definition code for java.security.cert.CertSelector  selector)
Sets the required constraints on the target certificate. The constraints are specified as an instance of CertSelector. If null, no constraints are defined.

Note that the CertSelector specified is cloned to protect against subsequent modifications.

Parameters:
selector - a CertSelector specifying the constraints on the target certificate (or null)
See Also:
getTargetCertConstraints() sample code for java.security.cert.PKIXParameters.getTargetCertConstraints() definition code for java.security.cert.PKIXParameters.getTargetCertConstraints()

clone sample code for java.security.cert.PKIXParameters.clone() definition code for java.security.cert.PKIXParameters.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Makes a copy of this PKIXParameters object. Changes to the copy will not affect the original and vice versa.

Specified by:
clone sample code for java.security.cert.CertPathParameters.clone() definition code for java.security.cert.CertPathParameters.clone() in interface CertPathParameters sample code for java.security.cert.CertPathParameters definition code for java.security.cert.CertPathParameters
Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a copy of this PKIXParameters object
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

toString sample code for java.security.cert.PKIXParameters.toString() definition code for java.security.cert.PKIXParameters.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a formatted string describing the parameters.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a formatted string describing the parameters.