Package com.itextpdf.text.pdf.security
Class CertificateUtil
- java.lang.Object
-
- com.itextpdf.text.pdf.security.CertificateUtil
-
public class CertificateUtil extends Object
This class contains a series of static methods that allow you to retrieve information from a Certificate.
-
-
Constructor Summary
Constructors Constructor Description CertificateUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CRL
getCRL(String url)
Gets the CRL object using a CRL URL.static CRL
getCRL(X509Certificate certificate)
Gets a CRL from a certificatestatic String
getCRLURL(X509Certificate certificate)
Gets the URL of the Certificate Revocation List for a Certificatestatic String
getOCSPURL(X509Certificate certificate)
Retrieves the OCSP URL from the given certificate.static String
getTSAURL(X509Certificate certificate)
Gets the URL of the TSA if it's available on the certificate
-
-
-
Method Detail
-
getCRL
public static CRL getCRL(X509Certificate certificate) throws CertificateException, CRLException, IOException
Gets a CRL from a certificate- Parameters:
certificate
-- Returns:
- the CRL or null if there's no CRL available
- Throws:
CertificateException
CRLException
IOException
-
getCRLURL
public static String getCRLURL(X509Certificate certificate) throws 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:
CertificateParsingException
IOException
-
getCRL
public static CRL getCRL(String url) throws IOException, CertificateException, CRLException
Gets the CRL object using a CRL URL.- Parameters:
url
- the URL where to get the CRL- Returns:
- a CRL object
- Throws:
IOException
CertificateException
CRLException
-
getOCSPURL
public static String getOCSPURL(X509Certificate certificate)
Retrieves the OCSP URL from the given certificate.- Parameters:
certificate
- the certificate- Returns:
- the URL or null
- Throws:
IOException
-
getTSAURL
public static String getTSAURL(X509Certificate certificate)
Gets the URL of the TSA if it's available on the certificate- Parameters:
certificate
- a certificate- Returns:
- a TSA URL
- Throws:
IOException
-
-