public class PKIXParameters extends Object implements CertPathParameters
PKIX CertPathValidator.
The parameters must be created with trusted certificate authorities (trust anchors).
CertPathValidator,
CertPathParameters| Constructor and Description |
|---|
PKIXParameters(KeyStore keyStore)
Creates a new
PKIXParameters instance with the trusted X509Certificate entries from the specified KeyStore. |
PKIXParameters(Set<TrustAnchor> trustAnchors)
Creates a new
PKIXParameters instance with the specified set of
trusted certificate authorities. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCertPathChecker(PKIXCertPathChecker checker)
Adds the specified
PKIXCertPathChecker to the list of
certification path checkers. |
void |
addCertStore(CertStore store)
Adds a certificate store to the list of certificate stores that are used
to find certificates and CRLs.
|
Object |
clone()
Clones this
PKIXParameters instance. |
List<PKIXCertPathChecker> |
getCertPathCheckers()
Returns the list of checkers for the certification path.
|
List<CertStore> |
getCertStores()
Returns the list of certificate stores that are used to find certificates
and CRLs.
|
Date |
getDate()
Returns the time for which the validation of the certification path
should be evaluated.
|
Set<String> |
getInitialPolicies()
Returns the list of policies (as OID strings) that would be acceptable
for the purpose of certification path processing.
|
boolean |
getPolicyQualifiersRejected()
Returns whether certificates are rejected that include policy
qualifiers in a certificate policy extension that is marked as critical.
|
String |
getSigProvider()
Returns the name of the signature provider.
|
CertSelector |
getTargetCertConstraints()
Returns the constraints that are required for the target certificate.
|
Set<TrustAnchor> |
getTrustAnchors()
Returns a unmodifiable set of the trusted certificate authorities.
|
boolean |
isAnyPolicyInhibited()
Returns whether the any policy OID will be inhibited if it's
included in a certificate.
|
boolean |
isExplicitPolicyRequired()
Returns whether an acceptable policy needs to be explicit identified in
every certificate.
|
boolean |
isPolicyMappingInhibited()
Returns whether policy mapping is inhibited.
|
boolean |
isRevocationEnabled()
Returns whether the default revocation checking mechanism of the
underlying service provider is used.
|
void |
setAnyPolicyInhibited(boolean anyPolicyInhibited)
Sets whether the any policy OID should be inhibited if it's
included in a certificate.
|
void |
setCertPathCheckers(List<PKIXCertPathChecker> certPathCheckers)
Sets the list of checkers for the certification path.
|
void |
setCertStores(List<CertStore> certStores)
Set the list of certificate stores that are used to find certificates and
CRLs.
|
void |
setDate(Date date)
Sets the time for which the validation of the certification path should be
evaluated.
|
void |
setExplicitPolicyRequired(boolean explicitPolicyRequired)
Sets whether an an acceptable policy needs to be explicit identified in
every certificate.
|
void |
setInitialPolicies(Set<String> initialPolicies)
Sets the list of policies (as OID strings) that would be acceptable for
the purpose of certification path processing.
|
void |
setPolicyMappingInhibited(boolean policyMappingInhibited)
Sets whether policy mapping is to be inhibited.
|
void |
setPolicyQualifiersRejected(boolean policyQualifiersRejected)
Sets whether certificates should be rejected that include policy
qualifiers in a certificate policy extension that is marked as critical.
|
void |
setRevocationEnabled(boolean revocationEnabled)
Sets whether the default revocation checking mechanism of the underlying
service provider should be used.
|
void |
setSigProvider(String sigProvider)
Sets the name of the preferred signature provider.
|
void |
setTargetCertConstraints(CertSelector targetCertConstraints)
Sets the constraints that are required for the target certificate.
|
void |
setTrustAnchors(Set<TrustAnchor> trustAnchors)
Sets the set of trusted certificate authorities.
|
String |
toString()
Returns a string representation of this
PKIXParameters instance. |
public PKIXParameters(Set<TrustAnchor> trustAnchors) throws InvalidAlgorithmParameterException
PKIXParameters instance with the specified set of
trusted certificate authorities.trustAnchors - the trusted CAs.InvalidAlgorithmParameterException - if trustAnchors is empty.public PKIXParameters(KeyStore keyStore) throws KeyStoreException, InvalidAlgorithmParameterException
PKIXParameters instance with the trusted X509Certificate entries from the specified KeyStore.keyStore - the key store containing trusted certificates.KeyStoreException - if the keyStore is not initialized.InvalidAlgorithmParameterException - if keyStore does not contained any trusted
certificate entry.public Set<TrustAnchor> getTrustAnchors()
public void setTrustAnchors(Set<TrustAnchor> trustAnchors) throws InvalidAlgorithmParameterException
trustAnchors - the set of trusted certificate authorities.InvalidAlgorithmParameterException - if trustAnchors is empty.public boolean isAnyPolicyInhibited()
true if the any policy OID will be inhibited,
otherwise false.public void setAnyPolicyInhibited(boolean anyPolicyInhibited)
anyPolicyInhibited - true if the any policy OID should be inhibited,
otherwise false.public List<PKIXCertPathChecker> getCertPathCheckers()
The list is unmodifiable and the entries in the list are cloned.
public void setCertPathCheckers(List<PKIXCertPathChecker> certPathCheckers)
The list is copied and the entries are cloned.
certPathCheckers - the list of checkers for the certification path, or null to clear the checkers.public void addCertPathChecker(PKIXCertPathChecker checker)
PKIXCertPathChecker to the list of
certification path checkers.checker - the PKIXCertPathChecker to add, if null, it
will be ignored.public List<CertStore> getCertStores()
public void setCertStores(List<CertStore> certStores)
certStores - the list of certificate stores.public void addCertStore(CertStore store)
store - the store to add, if null, it will be ignored.public Date getDate()
null for the current
time.public void setDate(Date date)
date - the time for the validation, or null for the current
time.public boolean isExplicitPolicyRequired()
true if an explicit policy is required, otherwise false.public void setExplicitPolicyRequired(boolean explicitPolicyRequired)
explicitPolicyRequired - true if an explicit policy is required, otherwise
false.public Set<String> getInitialPolicies()
public void setInitialPolicies(Set<String> initialPolicies)
initialPolicies - the list of policies, or an empty set or null if any
policy is acceptable.public boolean isPolicyMappingInhibited()
true if policy mapping is inhibited, otherwise false.public void setPolicyMappingInhibited(boolean policyMappingInhibited)
policyMappingInhibited - true if policy mapping is to be inhibited, otherwise
false.public boolean getPolicyQualifiersRejected()
true if the certificates should be rejected, otherwise
false.public void setPolicyQualifiersRejected(boolean policyQualifiersRejected)
policyQualifiersRejected - true if the certificates should be rejected, otherwise
false.public boolean isRevocationEnabled()
true if the default revocation checking mechanism is
used, otherwise false.public void setRevocationEnabled(boolean revocationEnabled)
revocationEnabled - true id the default revocation checking mechanism
should be used, otherwise false.public String getSigProvider()
null if none is
set.public void setSigProvider(String sigProvider)
If set, the specified provider will be preferred for creating signatures. If not set, the first provider found supporting creation of signatures will be used.
sigProvider - the name of the preferred signature provider, or null
if none is preferred.public CertSelector getTargetCertConstraints()
null if
none are set.public void setTargetCertConstraints(CertSelector targetCertConstraints)
targetCertConstraints - the constraints for the target certificate, or null if
none should be used.public Object clone()
PKIXParameters instance.clone in interface CertPathParametersclone in class Object