com.itextpdf.text.pdf.security
Class CertificateUtil

java.lang.Object
  extended by com.itextpdf.text.pdf.security.CertificateUtil

public class CertificateUtil
extends java.lang.Object

This class contains a series of static methods that allow you to retrieve information from a Certificate.


Constructor Summary
CertificateUtil()
           
 
Method Summary
static java.security.cert.CRL getCRL(java.lang.String url)
          Gets the CRL object using a CRL URL.
static java.security.cert.CRL getCRL(java.security.cert.X509Certificate certificate)
          Gets a CRL from a certificate
static java.lang.String getCRLURL(java.security.cert.X509Certificate certificate)
          Gets the URL of the Certificate Revocation List for a Certificate
static java.lang.String getOCSPURL(java.security.cert.X509Certificate certificate)
          Retrieves the OCSP URL from the given certificate.
static java.lang.String getTSAURL(java.security.cert.X509Certificate certificate)
          Gets the URL of the TSA if it's available on the certificate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CertificateUtil

public CertificateUtil()
Method Detail

getCRL

public static java.security.cert.CRL getCRL(java.security.cert.X509Certificate certificate)
                                     throws java.security.cert.CertificateException,
                                            java.security.cert.CRLException,
                                            java.io.IOException
Gets a CRL from a certificate

Parameters:
certificate -
Returns:
the CRL or null if there's no CRL available
Throws:
java.security.cert.CertificateException
java.security.cert.CRLException
java.io.IOException

getCRLURL

public static java.lang.String getCRLURL(java.security.cert.X509Certificate certificate)
                                  throws java.security.cert.CertificateParsingException
Gets the URL of the Certificate Revocation List for a Certificate

Parameters:
certificate - the Certificate
Returns:
the String where you can check if the certificate was revoked
Throws:
java.security.cert.CertificateParsingException
java.io.IOException

getCRL

public static java.security.cert.CRL getCRL(java.lang.String url)
                                     throws java.io.IOException,
                                            java.security.cert.CertificateException,
                                            java.security.cert.CRLException
Gets the CRL object using a CRL URL.

Parameters:
url - the URL where to get the CRL
Returns:
a CRL object
Throws:
java.io.IOException
java.security.cert.CertificateException
java.security.cert.CRLException

getOCSPURL

public static java.lang.String getOCSPURL(java.security.cert.X509Certificate certificate)
Retrieves the OCSP URL from the given certificate.

Parameters:
certificate - the certificate
Returns:
the URL or null
Throws:
java.io.IOException

getTSAURL

public static java.lang.String getTSAURL(java.security.cert.X509Certificate certificate)
Gets the URL of the TSA if it's available on the certificate

Parameters:
certificate - a certificate
Returns:
a TSA URL
Throws:
java.io.IOException


Copyright © 2013. All Rights Reserved.