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),
specifying a Set of TrustAnchor objects, each
of which identify a most-trusted CA. Alternatively, an application can call
PKIXParameters(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
or setDate, for instance) and then the
PKIXParameters is passed along with the CertPath
to be validated to CertPathValidator..
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.
CertPathValidator
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private List | |
| private CertSelector | |
| private List | |
| private Date | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private String | |
| private Set | |
| private Set |
| Access | Constructor and Description |
|---|---|
| public | PKIXParameters(Set<TrustAnchor>
a trustAnchors)Set of TrustAnchorsCreates an instance of |
| public | PKIXParameters(KeyStore
a keystore)KeyStore from which the set of
most-trusted CAs will be populatedCreates an instance of |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCertPathChecker(PKIXCertPathChecker
a checker)PKIXCertPathChecker to add to the list of
checks. If null, the checker is ignored (not added to list).Adds a |
| public void | addCertStore(CertStore
the store)CertStore to add. If null,
the store is ignored (not added to list).Adds a |
| public Object | Returns: a copy of thisPKIXParameters objectOverrides java. Implements java. Makes a copy of this |
| public List | Returns: an immutableList of
PKIXCertPathCheckers (may be empty, but not
null)Returns the |
| public List | Returns: an immutableList of CertStores
(may be empty, but never null)Returns an immutable |
| public Date | Returns: theDate, or null if not setReturns the time for which the validity of the certification path should be determined. |
| public Set | Returns: an immutableSet of initial policy OIDs in
String format, or an empty Set (implying any
policy is acceptable). Never returns null.Returns an immutable |
| public boolean | Returns: the current value of the PolicyQualifiersRejected flagGets the PolicyQualifiersRejected flag. |
| public String | Returns: the signature provider's name (ornull)Returns the signature provider's name, or |
| public CertSelector | Returns: aCertSelector specifying the constraints
on the target certificate (or null)Returns the required constraints on the target certificate. |
| public Set | Returns: an immutableSet of TrustAnchors
(never null)Returns an immutable |
| public boolean | Returns: true if the any policy OID is inhibited,
false otherwiseChecks whether the any policy OID should be processed if it is included in a certificate. |
| public boolean | Returns: true if explicit policy is required,
false otherwiseChecks if explicit policy is required. |
| public boolean | Returns: true if policy mapping is inhibited, false otherwiseChecks if policy mapping is inhibited. |
| public boolean | Returns: the current value of the RevocationEnabled flagChecks the RevocationEnabled flag. |
| public void | setAnyPolicyInhibited(boolean
true if the any policy OID is to be
inhibited, false otherwiseSets state to determine if the any policy OID should be processed if it is included in a certificate. |
| public void | setCertPathCheckers(List<PKIXCertPathChecker>
a checkers)List of PKIXCertPathCheckers.
May be null, in which case no additional checkers will be
used.Sets a |
| public void | setCertStores(List<CertStore>
a stores)List of CertStores (or
null)Sets the list of |
| public void | |
| public void | setExplicitPolicyRequired(boolean
true if explicit policy is to be required,
false otherwiseSets the ExplicitPolicyRequired flag. |
| public void | setInitialPolicies(Set<String>
a initialPolicies)Set of initial policy
OIDs in String format (or null)Sets the |
| public void | setPolicyMappingInhibited(boolean
true if policy mapping is to be inhibited,
false otherwiseSets the PolicyMappingInhibited flag. |
| public void | setPolicyQualifiersRejected(boolean
the new value of the PolicyQualifiersRejected
flag qualifiersRejected)Sets the PolicyQualifiersRejected flag. |
| public void | setRevocationEnabled(boolean
the new value of the RevocationEnabled flag val)Sets the RevocationEnabled flag. |
| public void | setSigProvider(String
the signature provider's name (or sigProvider)null)Sets the signature provider's name. |
| public void | setTargetCertConstraints(CertSelector
a selector)CertSelector specifying the constraints
on the target certificate (or null)Sets the required constraints on the target certificate. |
| public void | setTrustAnchors(Set<TrustAnchor>
a trustAnchors)Set of TrustAnchorsSets the |
| public String | Returns: a formatted string describing the parameters.Overrides java. Returns a formatted string describing the parameters. |
| anyPolicyInhibited | back to summary |
|---|---|
| private boolean anyPolicyInhibited | |
| certPathCheckers | back to summary |
|---|---|
| private List<PKIXCertPathChecker> certPathCheckers | |
| certSelector | back to summary |
|---|---|
| private CertSelector certSelector | |
| certStores | back to summary |
|---|---|
| private List<CertStore> certStores | |
| date | back to summary |
|---|---|
| private Date date | |
| explicitPolicyRequired | back to summary |
|---|---|
| private boolean explicitPolicyRequired | |
| policyMappingInhibited | back to summary |
|---|---|
| private boolean policyMappingInhibited | |
| policyQualifiersRejected | back to summary |
|---|---|
| private boolean policyQualifiersRejected | |
| revocationEnabled | back to summary |
|---|---|
| private boolean revocationEnabled | |
| sigProvider | back to summary |
|---|---|
| private String sigProvider | |
| unmodInitialPolicies | back to summary |
|---|---|
| private Set<String> unmodInitialPolicies | |
| unmodTrustAnchors | back to summary |
|---|---|
| private Set<TrustAnchor> unmodTrustAnchors | |
| PKIXParameters | back to summary |
|---|---|
| public PKIXParameters(Set<TrustAnchor> trustAnchors) throws InvalidAlgorithmParameterException Creates an instance of
Note that the
| |
| PKIXParameters | back to summary |
|---|---|
| public PKIXParameters(KeyStore keystore) throws KeyStoreException, InvalidAlgorithmParameterException Creates an instance of
| |
| addCertPathChecker | back to summary |
|---|---|
| public void addCertPathChecker(PKIXCertPathChecker checker) Adds a
Note that the
| |
| addCertStore | back to summary |
|---|---|
| public void addCertStore(CertStore store) Adds a
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Implements java. Makes a copy of this
| |
| getCertPathCheckers | back to summary |
|---|---|
| public List Returns the
| |
| getCertStores | back to summary |
|---|---|
| public List Returns an immutable
| |
| getDate | back to summary |
|---|---|
| public Date getDate() Returns the time for which the validity of the certification path
should be determined. If
Note that the | |
| getInitialPolicies | back to summary |
|---|---|
| public Set Returns an immutable
| |
| getPolicyQualifiersRejected | back to summary |
|---|---|
| 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
| |
| getSigProvider | back to summary |
|---|---|
| public String getSigProvider() Returns the signature provider's name, or
| |
| getTargetCertConstraints | back to summary |
|---|---|
| public CertSelector getTargetCertConstraints() Returns the required constraints on the target certificate.
The constraints are returned as an instance of Note that the
| |
| getTrustAnchors | back to summary |
|---|---|
| public Set Returns an immutable
| |
| isAnyPolicyInhibited | back to summary |
|---|---|
| public boolean isAnyPolicyInhibited() Checks whether the any policy OID should be processed if it is included in a certificate.
| |
| isExplicitPolicyRequired | back to summary |
|---|---|
| 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.
| |
| isPolicyMappingInhibited | back to summary |
|---|---|
| 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).
| |
| isRevocationEnabled | back to summary |
|---|---|
| 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, unless a
| |
| setAnyPolicyInhibited | back to summary |
|---|---|
| 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 (
| |
| setCertPathCheckers | back to summary |
|---|---|
| public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) Sets a
Each
This method allows sophisticated applications to extend a PKIX
Regardless of whether these additional
Note that the
| |
| setCertStores | back to summary |
|---|---|
| public void setCertStores(List<CertStore> stores) Sets the list of
Note that the
| |
| setDate | back to summary |
|---|---|
| public void setDate(Date date) Sets the time for which the validity of the certification path
should be determined. If
Note that the | |
| setExplicitPolicyRequired | back to summary |
|---|---|
| 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.
| |
| setInitialPolicies | back to summary |
|---|---|
| public void setInitialPolicies(Set<String> initialPolicies) Sets the
Note that the
| |
| setPolicyMappingInhibited | back to summary |
|---|---|
| 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).
| |
| setPolicyQualifiersRejected | back to summary |
|---|---|
| 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 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.
| |
| setRevocationEnabled | back to summary |
|---|---|
| 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, unless a
When a
Note that when a
| |
| setSigProvider | back to summary |
|---|---|
| public void setSigProvider(String sigProvider) Sets the signature provider's name. The specified provider will be
preferred when creating
| |
| setTargetCertConstraints | back to summary |
|---|---|
| public void setTargetCertConstraints(CertSelector selector) Sets the required constraints on the target certificate.
The constraints are specified as an instance of
Note that the
| |
| setTrustAnchors | back to summary |
|---|---|
| public void setTrustAnchors(Set<TrustAnchor> trustAnchors) throws InvalidAlgorithmParameterException Sets the
Note that the
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a formatted string describing the parameters.
| |