APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.provider.certpath

pack-priv abstract Class Builder

extends Object
Class Inheritance
Known Direct Subclasses
sun.security.provider.certpath.ForwardBuilder
Imports
java.io.IOException, java.security.GeneralSecurityException, java.security.cert.*, java.util.*, sun.security.provider.certpath.PKIX.BuilderParams, sun.security.util.Debug

Abstract class representing a builder, which is able to retrieve matching certificates and is able to verify a particular certificate.
Authors
Sean Mullan, Yassir Elley
Since
1.4

Field Summary

Modifier and TypeField and Description
pack-priv final PKIX.BuilderParams
private static final Debug
private Set<String>
pack-priv final X509CertSelector
pack-priv static final boolean
USE_AIA

Flag indicating whether support for the caIssuers field of the Authority Information Access extension shall be enabled.

Constructor Summary

AccessConstructor and Description
pack-priv
Builder(PKIX.BuilderParams
the parameter set used to build a certification path
buildParams
)

Initialize the builder with the input parameters.

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract void
addCertToPath(X509Certificate
the certificate to be added
cert
,
LinkedList<X509Certificate>
the certification path list
certPathList
)

Adds the certificate to the certPathList

pack-priv boolean
addMatchingCerts(X509CertSelector selector, Collection<CertStore> certStores, Collection<X509Certificate> resultCerts, boolean checkAll)

Search the specified CertStores and add all certificates matching selector to resultCerts.

pack-priv abstract Collection<X509Certificate>
getMatchingCerts(State
the current State
currentState
,
List<CertStore>
list of CertStores
certStores
)

Retrieves certificates from the list of certStores using the buildParams and the currentState as a filter

pack-priv Set<String>

Returns:

the Set of policies any of which must exist in a cert's certificate policies extension in order for a cert to be selected.
getMatchingPolicies
()

This method can be used as an optimization to filter out certificates that do not have policies which are valid.

pack-priv abstract boolean

Returns:

a boolean value indicating whether the cert completes the path.
isPathCompleted
(X509Certificate
the certificate to test
cert
)

Verifies whether the input certificate completes the path.

pack-priv abstract void
removeFinalCertFromPath(LinkedList<X509Certificate>
the certification path list
certPathList
)

Removes final certificate from the certPathList

pack-priv abstract void
verifyCert(X509Certificate
the certificate to be verified
cert
,
State
the current state against which the cert is verified
currentState
,
List<X509Certificate>
the certPathList generated thus far
certPathList
)

Verifies the cert against the currentState, using the certPathList generated thus far to help with loop detection

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buildParamsback to summary
pack-priv final PKIX.BuilderParams buildParams
debugback to summary
private static final Debug debug
matchingPoliciesback to summary
private Set<String> matchingPolicies
targetCertConstraintsback to summary
pack-priv final X509CertSelector targetCertConstraints
USE_AIAback to summary
pack-priv static final boolean USE_AIA

Flag indicating whether support for the caIssuers field of the Authority Information Access extension shall be enabled. Currently disabled by default for compatibility reasons.

Constructor Detail

Builderback to summary
pack-priv Builder(PKIX.BuilderParams buildParams)

Initialize the builder with the input parameters.

Parameters
buildParams:PKIX.BuilderParams

the parameter set used to build a certification path

Method Detail

addCertToPathback to summary
pack-priv abstract void addCertToPath(X509Certificate cert, LinkedList<X509Certificate> certPathList)

Adds the certificate to the certPathList

Parameters
cert:X509Certificate

the certificate to be added

certPathList:LinkedList<X509Certificate>

the certification path list

addMatchingCertsback to summary
pack-priv boolean addMatchingCerts(X509CertSelector selector, Collection<CertStore> certStores, Collection<X509Certificate> resultCerts, boolean checkAll)

Search the specified CertStores and add all certificates matching selector to resultCerts. If the targetCert criterion of the selector is set, only that cert is examined and the CertStores are not searched. If checkAll is true, all CertStores are searched for matching certs. If false, the method returns as soon as the first CertStore returns a matching cert(s). Returns true iff resultCerts changed (a cert was added to the collection)

getMatchingCertsback to summary
pack-priv abstract Collection<X509Certificate> getMatchingCerts(State currentState, List<CertStore> certStores) throws CertStoreException, CertificateException, IOException

Retrieves certificates from the list of certStores using the buildParams and the currentState as a filter

Parameters
currentState:State

the current State

certStores:List<CertStore>

list of CertStores

getMatchingPoliciesback to summary
pack-priv Set<String> getMatchingPolicies()

This method can be used as an optimization to filter out certificates that do not have policies which are valid. It returns the set of policies (String OIDs) that should exist in the certificate policies extension of the certificate that is needed by the builder. The logic applied is as follows:

1) If some initial policies have been set *and* policy mappings are inhibited, then acceptable certificates are those that include the ANY_POLICY OID or with policies that intersect with the initial policies. 2) If no initial policies have been set *or* policy mappings are not inhibited then we don't have much to work with. All we know is that a certificate must have *some* policy because if it didn't have any policy then the policy tree would become null (and validation would fail).

Returns:Set<String>

the Set of policies any of which must exist in a cert's certificate policies extension in order for a cert to be selected.

isPathCompletedback to summary
pack-priv abstract boolean isPathCompleted(X509Certificate cert)

Verifies whether the input certificate completes the path. When building in the forward direction, a trust anchor will complete the path.

Parameters
cert:X509Certificate

the certificate to test

Returns:boolean

a boolean value indicating whether the cert completes the path.

removeFinalCertFromPathback to summary
pack-priv abstract void removeFinalCertFromPath(LinkedList<X509Certificate> certPathList)

Removes final certificate from the certPathList

Parameters
certPathList:LinkedList<X509Certificate>

the certification path list

verifyCertback to summary
pack-priv abstract void verifyCert(X509Certificate cert, State currentState, List<X509Certificate> certPathList) throws GeneralSecurityException

Verifies the cert against the currentState, using the certPathList generated thus far to help with loop detection

Parameters
cert:X509Certificate

the certificate to be verified

currentState:State

the current state against which the cert is verified

certPathList:List<X509Certificate>

the certPathList generated thus far