public class X509CRLStream
extends java.lang.Object
A typical use-case may look like this:
X509Certificates[] consideredCertificates = ...; X509Certificates crlIssuerCertificate = ...; RevokedCertificatesCRLListener listener = new RevokedCertificatesCRLListener(consideredCertificates, crlIssuerCertificate); X509CRLStream crlStream = new X509CRLStream(listener); URL crlUrl = ...; InputStream crlInputStream = crlUrl.openStream(); crlStream.parse(crlInputStream); Hashtable revocationEntriesTable = listener.getRevokedCertificates(); for (int i = 0; i < consideredCertificates.length; i++) { RevokedCertificate revocationEntry = (RevokedCertificate) revocationEntriesTable.remove(consideredCertificates[i]); if (revocationEntry != null) { // this certificate is listed on the CRL, check reason code, check revocation time,... } }where the
consideredCertificates
is a list of certificate
which should be checked for revocation. The
revocationEntriesTable
contains the CRL entries indexed with
the certificate objects. Please note that only such revocation entries are
in this table which correspond to certificates in the list specified by
consideredCertificates
.Constructor and Description |
---|
X509CRLStream(CRLListener listener)
Creates a new CRL stream parser which notifies the given listener about
the contents of the CRL.
|
Modifier and Type | Method and Description |
---|---|
CRLListener |
getListener()
Gets the CRL listener used by this CRLStream.
|
void |
parse(java.io.InputStream crlStream)
Parse the CRL from the given stream.
|
public X509CRLStream(CRLListener listener)
listener
- The listener to notify during parsing.public void parse(java.io.InputStream crlStream) throws java.io.IOException, java.security.cert.CRLException
crlStream
- The stream that provides the CRL in DER encoded format.java.io.IOException
- If reading from the stream fails.java.security.cert.CRLException
- If the CRL has an invalid format.public CRLListener getListener()