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

public Class DistributionPointFetcher

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.URI, java.security.GeneralSecurityException, .InvalidAlgorithmParameterException, .NoSuchAlgorithmException, .PublicKey, java.security.cert.*, java.util.*, javax.security.auth.x500.X500Principal, sun.security.util.Debug, .Event, sun.security.x509.*

Class to obtain CRLs via the CRLDistributionPoints extension.

This class uses the URICertStore class to fetch CRLs. The URICertStore class also implements CRL caching: see the class description for more information.

Authors
Andreas Sterbenz, Sean Mullan
Since
1.4.2

Field Summary

Modifier and TypeField and Description
private static final boolean[]
private static final Debug

Constructor Summary

AccessConstructor and Description
private
DistributionPointFetcher()

Private instantiation only.

Method Summary

Modifier and TypeMethod and Description
private static X509CRL
getCRL(URIName name)

Download CRL from given URI.

public static Collection<X509CRL>
getCRLs(X509CRLSelector selector, boolean signFlag, PublicKey prevKey, X509Certificate prevCert, String provider, List<CertStore> certStores, boolean[] reasonsMask, Set<TrustAnchor> trustAnchors, Date validity, String variant, TrustAnchor anchor)

Return the X509CRLs matching this selector.

private static Collection<X509CRL>
getCRLs(X509CRLSelector selector, X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask, boolean signFlag, PublicKey prevKey, X509Certificate prevCert, String provider, List<CertStore> certStores, Set<TrustAnchor> trustAnchors, Date validity, String variant, TrustAnchor anchor)

Download CRLs from the given distribution point, verify and return them.

private static Collection<X509CRL>
getCRLs(X500Name name, X500Principal certIssuer, List<CertStore> certStores)

Fetch CRLs from certStores.

private static GeneralNames
getFullNames(X500Name issuer, RDN rdn)

Append relative name to the issuer name and return a new GeneralNames object.

private static boolean
issues(X509CertImpl
the certificate
cert
,
X509CRLImpl
the CRL to be verified
crl
,
String
the name of the signature provider
provider
)

Verifies whether a CRL is issued by a certain certificate

pack-priv static boolean

Returns:

true if ok, false if not
verifyCRL
(X509CertImpl
the certificate whose revocation status is being checked
certImpl
,
DistributionPoint
one of the distribution points of the certificate
point
,
X509CRL
the CRL
crl
,
boolean[]
the interim reasons mask
reasonsMask
,
boolean
true if prevKey can be used to verify the CRL
signFlag
,
PublicKey
the public key that verifies the certificate's signature
prevKey
,
X509Certificate
the certificate whose public key verifies certImpl's signature
prevCert
,
String
the Signature provider to use
provider
,
Set<TrustAnchor>
a Set of TrustAnchors
trustAnchors
,
List<CertStore>
a List of CertStores to be used in finding certificates and CRLs
certStores
,
Date
the time for which the validity of the CRL issuer's certification path should be determined
validity
,
String variant, TrustAnchor anchor)

Verifies a CRL for the given certificate's Distribution Point to ensure it is appropriate for checking the revocation status.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALL_REASONSback to summary
private static final boolean[] ALL_REASONS
debugback to summary
private static final Debug debug

Constructor Detail

DistributionPointFetcherback to summary
private DistributionPointFetcher()

Private instantiation only.

Method Detail

getCRLback to summary
private static X509CRL getCRL(URIName name) throws CertStoreException

Download CRL from given URI.

getCRLsback to summary
public static Collection<X509CRL> getCRLs(X509CRLSelector selector, boolean signFlag, PublicKey prevKey, X509Certificate prevCert, String provider, List<CertStore> certStores, boolean[] reasonsMask, Set<TrustAnchor> trustAnchors, Date validity, String variant, TrustAnchor anchor) throws CertStoreException

Return the X509CRLs matching this selector. The selector must be an X509CRLSelector with certificateChecking set.

getCRLsback to summary
private static Collection<X509CRL> getCRLs(X509CRLSelector selector, X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask, boolean signFlag, PublicKey prevKey, X509Certificate prevCert, String provider, List<CertStore> certStores, Set<TrustAnchor> trustAnchors, Date validity, String variant, TrustAnchor anchor) throws CertStoreException

Download CRLs from the given distribution point, verify and return them. See the top of the class for current limitations.

Exceptions
CertStoreException:
if there is an error retrieving the CRLs from one of the GeneralNames and no other CRLs are retrieved from the other GeneralNames. If more than one GeneralName throws an exception then the one from the last GeneralName is thrown.
getCRLsback to summary
private static Collection<X509CRL> getCRLs(X500Name name, X500Principal certIssuer, List<CertStore> certStores) throws CertStoreException

Fetch CRLs from certStores.

Exceptions
CertStoreException:
if there is an error retrieving the CRLs from one of the CertStores and no other CRLs are retrieved from the other CertStores. If more than one CertStore throws an exception then the one from the last CertStore is thrown.
getFullNamesback to summary
private static GeneralNames getFullNames(X500Name issuer, RDN rdn) throws IOException

Append relative name to the issuer name and return a new GeneralNames object.

issuesback to summary
private static boolean issues(X509CertImpl cert, X509CRLImpl crl, String provider) throws IOException

Verifies whether a CRL is issued by a certain certificate

Parameters
cert:X509CertImpl

the certificate

crl:X509CRLImpl

the CRL to be verified

provider:String

the name of the signature provider

verifyCRLback to summary
pack-priv static boolean verifyCRL(X509CertImpl certImpl, DistributionPoint point, X509CRL crl, boolean[] reasonsMask, boolean signFlag, PublicKey prevKey, X509Certificate prevCert, String provider, Set<TrustAnchor> trustAnchors, List<CertStore> certStores, Date validity, String variant, TrustAnchor anchor) throws CRLException, IOException

Verifies a CRL for the given certificate's Distribution Point to ensure it is appropriate for checking the revocation status.

Parameters
certImpl:X509CertImpl

the certificate whose revocation status is being checked

point:DistributionPoint

one of the distribution points of the certificate

crl:X509CRL

the CRL

reasonsMask:boolean[]

the interim reasons mask

signFlag:boolean

true if prevKey can be used to verify the CRL

prevKey:PublicKey

the public key that verifies the certificate's signature

prevCert:X509Certificate

the certificate whose public key verifies certImpl's signature

provider:String

the Signature provider to use

trustAnchors:Set<TrustAnchor>

a Set of TrustAnchors

certStores:List<CertStore>

a List of CertStores to be used in finding certificates and CRLs

validity:Date

the time for which the validity of the CRL issuer's certification path should be determined

Returns:boolean

true if ok, false if not