Class CRLVerifier


  • public final class CRLVerifier
    extends Object
    Class that contains functions for retrieving and verifying certificate revocation lists
    • Method Detail

      • verifyCertificateCRL

        public static RevocationInfo verifyCertificateCRL​(X509Certificate cert)
        Extracts the CRL distribution points from the certificate (if available) and checks the certificate revocation status against the CRLs coming from the distribution points. Supports HTTP, HTTPS, FTP and LDAP based URLs.
        Parameters:
        cert - Certificate to verify
        Returns:
        a RevocationInfo object with the validation result
      • verifyCertificateCRL

        public static RevocationInfo verifyCertificateCRL​(X509Certificate cert,
                                                          X509CRL crl)
        Verifies the revocation status of a certificate against a CRL
        Parameters:
        cert - The certificate to verify
        crl - The CRL to use for verifying
        Returns:
        a RevocationInfo object with the validation result
      • downloadCRLFromLDAP

        public static X509CRL downloadCRLFromLDAP​(String ldapURL)
                                           throws NamingException,
                                                  CertificateException,
                                                  CRLException
        Downloads a CRL from given LDAP url, e.g. ldap://ldap.infonotary.com/dc=identity-ca,dc=infonotary,dc=com
        Parameters:
        ldapURL - The URL for downloading the CRL from a ldap server
        Returns:
        a CRL
        Throws:
        NamingException - if downloading CRL from ldap fails
        CertificateException - if a CertificateFactory cannot be instantiated
        CRLException - if the retrieved CRL cannot be instantiated as a Java object
      • downloadCRLFromWeb

        public static X509CRL downloadCRLFromWeb​(String crlURL)
                                          throws IOException,
                                                 CRLException,
                                                 CertificateException
        Downloads a CRL from given HTTP/HTTPS/FTP URL, e.g. http://crl.infonotary.com/crl/identity-ca.crl
        Parameters:
        crlURL - The URL for downloading the CRL
        Returns:
        a CRL
        Throws:
        IOException - if a connection cannot be opened based on the given URL
        CertificateException - if a CertificateFactory cannot be instantiated
        CRLException - if the retrieved CRL cannot be instantiated as a Java object
      • getCrlDistributionPoints

        public static List<String> getCrlDistributionPoints​(X509Certificate cert)
                                                     throws IOException
        Extracts all CRL distribution point URLs from the "CRL Distribution Point" extension in a X.509 certificate. If CRL distribution point extension is unavailable, returns an empty list.
        Parameters:
        cert - The certificate that should be used for extracting the distribution points
        Returns:
        a list CRL distribution points
        Throws:
        IOException - if the given certificate cannot be read