Class TSLCertificateExtensionAnalyzer


  • public class TSLCertificateExtensionAnalyzer
    extends java.lang.Object

    Utilities wrapper for analyze the extensions defined in a specific X509v3 certificate.

    Project:

    Library for the integration with the services of @Firma, eVisor and TS@.

    Version:
    1.2, 19/09/2022.
    • Constructor Detail

      • TSLCertificateExtensionAnalyzer

        public TSLCertificateExtensionAnalyzer​(java.security.cert.X509Certificate cert)
                                        throws TSLCertificateValidationException
        Constructor method for the class TSLCertificateExtensionAnalyzer.java.
        Parameters:
        cert - X509v3 certificate to analyze.
        Throws:
        TSLCertificateValidationException - If the input certificate is null, or there is some error extracting its information.
      • TSLCertificateExtensionAnalyzer

        public TSLCertificateExtensionAnalyzer​(org.bouncycastle.asn1.x509.Certificate cert)
                                        throws TSLCertificateValidationException
        Constructor method for the class TSLCertificateExtensionAnalyzer.java.
        Parameters:
        cert - X509v3 Certificate (Bouncy Castle Provider implementation) to analyze.
        Throws:
        TSLCertificateValidationException - If the input certificate is null, or there is some error extracting its information.
    • Method Detail

      • getCertificate

        public final org.bouncycastle.asn1.x509.Certificate getCertificate()
        Gets the certificate associated to this analyzer.
        Returns:
        X509v3 certificate used in this analyzer.
      • getQcStatementsOids

        public final java.util.List<java.lang.String> getQcStatementsOids()
        Gets the value of the attribute qcStatementsOids.
        Returns:
        the value of the attribute qcStatementsOids.
      • isThereSomeQcStatementExtension

        public final boolean isThereSomeQcStatementExtension()
        Checks if the certificate has some QcStatement extension.
        Returns:
        true if the certificate has some QcStatement extension, otherwise false.
      • hasQcStatementExtensionOid

        public final boolean hasQcStatementExtensionOid​(java.lang.String qcStatementOid)
        Checks if the certificate has the input QcStatement Extension OID.
        Parameters:
        qcStatementOid - QcStatement Extension OID in String representation.
        Returns:
        true if the certificate has the QcStatement Extension OID, otherwise false.
      • hasSomeQcStatementExtensionOid

        public final boolean hasSomeQcStatementExtensionOid​(java.util.List<java.lang.String> qcStatementOidsList)
        Checks if the certificate has the input QcStatement Extension OID.
        Parameters:
        qcStatementOidsList - QcStatement Extension OIDs List to check.
        Returns:
        true if the certificate has some of the input QcStatement Extension OID, otherwise false.
      • isThereSomeQcStatementEuTypeExtension

        public final boolean isThereSomeQcStatementEuTypeExtension()
        Checks if the certificate has the QcStatement EuType extension.
        Returns:
        true if the certificate has the QcStatement EuType extension, otherwise false.
      • hasQcStatementEuTypeExtensionOid

        public final boolean hasQcStatementEuTypeExtensionOid​(java.lang.String qcStatementEuTypeOid)
        Checks if the certificate has the input QcStatement EuType Extension OID.
        Parameters:
        qcStatementEuTypeOid - QcStatement EuType Extension OID in String representation.
        Returns:
        true if the certificate has the QcStatement EuType Extension OID, otherwise false.
      • isThereSomeCertPolPolInfExtension

        public final boolean isThereSomeCertPolPolInfExtension()
        Checks if the certificate has some Certification Policies - Policy Information extension.
        Returns:
        true if the certificate has some Certification Policies - Policy Information extension, otherwise false.
      • hasCertPolPolInfExtensionOid

        public final boolean hasCertPolPolInfExtensionOid​(java.lang.String certPolPolInfOid)
        Checks if the certificate has the Certification Policies - Policy Information Extension OID.
        Parameters:
        certPolPolInfOid - Certification Policies - Policy Information Extension OID in String representation.
        Returns:
        true if the certificate has the Certification Policies - Policy Information Extension OID, otherwise false.
      • hasSomeCertPolPolInfExtensionOid

        public final boolean hasSomeCertPolPolInfExtensionOid​(java.util.List<java.lang.String> certPolPolInfOidsList)
        Checks if the certificate has some of the input Certification Policies - Policy Information Extension OIDs.
        Parameters:
        certPolPolInfOidsList - Certification Policies - Policy Information Extension OIDs List to check.
        Returns:
        true if the certificate has some of the input Certification Policies - Policy Information Extension OIDs, otherwise false.