com.itextpdf.text.pdf.security
Class CrlClientOnline

java.lang.Object
  extended by com.itextpdf.text.pdf.security.CrlClientOnline
All Implemented Interfaces:
CrlClient

public class CrlClientOnline
extends Object
implements CrlClient

An implementation of the CrlClient that fetches the CRL bytes from an URL.

Author:
Paulo Soares

Field Summary
protected  List<URL> urls
          The URLs of the CRLs.
 
Constructor Summary
CrlClientOnline()
          Creates a CrlClientOnline instance that will try to find a single CRL by walking through the certificate chain.
CrlClientOnline(Certificate[] chain)
          Creates a CrlClientOnline instance using a certificate chain.
CrlClientOnline(String... crls)
          Creates a CrlClientOnline instance using one or more URLs.
CrlClientOnline(URL... crls)
          Creates a CrlClientOnline instance using one or more URLs.
 
Method Summary
protected  void addUrl(String url)
          Adds an URL to the list of CRL URLs
protected  void addUrl(URL url)
          Adds an URL to the list of CRL URLs
 Collection<byte[]> getEncoded(X509Certificate checkCert, String url)
          Fetches the CRL bytes from an URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

urls

protected List<URL> urls
The URLs of the CRLs.

Constructor Detail

CrlClientOnline

public CrlClientOnline()
Creates a CrlClientOnline instance that will try to find a single CRL by walking through the certificate chain.


CrlClientOnline

public CrlClientOnline(String... crls)
Creates a CrlClientOnline instance using one or more URLs.


CrlClientOnline

public CrlClientOnline(URL... crls)
Creates a CrlClientOnline instance using one or more URLs.


CrlClientOnline

public CrlClientOnline(Certificate[] chain)
Creates a CrlClientOnline instance using a certificate chain.

Method Detail

addUrl

protected void addUrl(String url)
Adds an URL to the list of CRL URLs

Parameters:
url - an URL in the form of a String

addUrl

protected void addUrl(URL url)
Adds an URL to the list of CRL URLs

Parameters:
url - an URL object

getEncoded

public Collection<byte[]> getEncoded(X509Certificate checkCert,
                                     String url)
Fetches the CRL bytes from an URL. If no url is passed as parameter, the url will be obtained from the certificate. If you want to load a CRL from a local file, subclass this method and pass an URL with the path to the local file to this method. An other option is to use the CrlClientOffline class.

Specified by:
getEncoded in interface CrlClient
Parameters:
checkCert - the certificate from which a CRL URL can be obtained
url - a CRL url if you don't want to obtain it from the certificate
Returns:
a collection of byte array each representing a crl. It may return null or an empty collection
See Also:
CrlClient.getEncoded(java.security.cert.X509Certificate, java.lang.String)


Copyright © 2013. All Rights Reserved.