Package java.security.cert
Class PKIXBuilderParameters
java.lang.Object
java.security.cert.PKIXParameters
java.security.cert.PKIXBuilderParameters
- All Implemented Interfaces:
Cloneable,CertPathParameters
public class PKIXBuilderParameters extends PKIXParameters
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.
- See Also:
CertPathBuilder,CertPathParameters
-
Constructor Summary
Constructors Constructor Description PKIXBuilderParameters(KeyStore keyStore, CertSelector targetConstraints)Creates a newPKIXBuilderParametersinstance with the trustedX509Certificateentries from the specifiedKeyStore.PKIXBuilderParameters(Set<TrustAnchor> trustAnchors, CertSelector targetConstraints)Creates a newPKIXBuilderParametersinstance with the specified set ofTrustAnchorand certificate constraints. -
Method Summary
Modifier and Type Method Description intgetMaxPathLength()Returns the maximum length of a certification path.voidsetMaxPathLength(int maxPathLength)Set the maximum length of a certification path.StringtoString()Returns a string representation of thisPKIXBuilderParametersinstance.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
-
Constructor Details
-
PKIXBuilderParameters
public PKIXBuilderParameters(Set<TrustAnchor> trustAnchors, CertSelector targetConstraints) throws InvalidAlgorithmParameterExceptionCreates a newPKIXBuilderParametersinstance with the specified set ofTrustAnchorand certificate constraints.- Parameters:
trustAnchors- the set ofTrustAnchors.targetConstraints- the certificate constraints.- Throws:
InvalidAlgorithmParameterException- iftrustAnchorsis empty.ClassCastException- if one of the items intrustAnchorsis not an instance ofjava.security.cert.TrustAnchor.
-
PKIXBuilderParameters
public PKIXBuilderParameters(KeyStore keyStore, CertSelector targetConstraints) throws KeyStoreException, InvalidAlgorithmParameterExceptionCreates a newPKIXBuilderParametersinstance with the trustedX509Certificateentries from the specifiedKeyStore.- Parameters:
keyStore- the key store containing trusted certificates.targetConstraints- the certificate constraints.- Throws:
KeyStoreException- if thekeyStoreis not initialized.InvalidAlgorithmParameterException- ifkeyStoredoes not contained any trusted certificate entry.
-
-
Method Details
-
getMaxPathLength
public int getMaxPathLength()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
-1if it is unlimited.
-
setMaxPathLength
public void setMaxPathLength(int maxPathLength)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- ifmaxPathLengthis less than-1.
-
toString
Returns a string representation of thisPKIXBuilderParametersinstance.- Overrides:
toStringin classPKIXParameters- Returns:
- a string representation of this
PKIXBuilderParametersinstance.
-