Package com.itextpdf.signatures
Class CertificateUtil
java.lang.Object
com.itextpdf.signatures.CertificateUtil
This class contains a series of static methods that allow you to retrieve information from a Certificate.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CRLGets the CRL object using a CRL URL.static CRLgetCRL(X509Certificate certificate) Gets a CRL from an X509 certificate.static StringgetCRLURL(X509Certificate certificate) Gets the URL of the Certificate Revocation List for a Certificatestatic StringgetOCSPURL(X509Certificate certificate) Retrieves the OCSP URL from the given certificate.static StringgetTSAURL(X509Certificate certificate) Gets the URL of the TSA if it's available on the certificate
-
Constructor Details
-
CertificateUtil
public CertificateUtil()
-
-
Method Details
-
getCRL
public static CRL getCRL(X509Certificate certificate) throws CertificateException, CRLException, IOException Gets a CRL from an X509 certificate.- Parameters:
-
certificate- the X509Certificate to extract the CRL from - Returns:
- CRL or null if there's no CRL available
- Throws:
-
IOException- thrown when the URL couldn't be opened properly. -
CertificateException- thrown if there's no X509 implementation in the provider. -
CRLException- thrown when encountering errors when parsing the CRL.
-
getCRLURL
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
-
getCRL
Gets the CRL object using a CRL URL.- Parameters:
-
url- the URL where the CRL is located - Returns:
- CRL object
- Throws:
-
IOException- thrown when the URL couldn't be opened properly. -
CertificateException- thrown if there's no X509 implementation in the provider. -
CRLException- thrown when encountering errors when parsing the CRL.
-
getOCSPURL
Retrieves the OCSP URL from the given certificate.- Parameters:
-
certificate- the certificate - Returns:
- the URL or null
-
getTSAURL
Gets the URL of the TSA if it's available on the certificate- Parameters:
-
certificate- a certificate - Returns:
- a TSA URL
-