Class CertificateExtension

java.lang.Object
com.itextpdf.signatures.validation.v1.extensions.CertificateExtension
Direct Known Subclasses:
BasicConstraintsExtension, ExtendedKeyUsageExtension, KeyUsageExtension

public class CertificateExtension extends Object
Class representing certificate extension with all the information required for validation.
  • Constructor Details

    • CertificateExtension

      public CertificateExtension (String extensionOid, IASN1Primitive extensionValue)
      Create new instance of CertificateExtension using provided extension OID and value.
      Parameters:
      extensionOid - String, which represents extension OID
      extensionValue - IASN1Primitive, which represents extension value
  • Method Details

    • getExtensionValue

      public IASN1Primitive getExtensionValue()
      Get extension value
      Returns:
      IASN1Primitive, which represents extension value
    • getExtensionOid

      public String getExtensionOid()
      Get extension OID
      Returns:
      String, which represents extension OID
    • existsInCertificate

      public boolean existsInCertificate (X509Certificate certificate)
      Check if this extension is present in the provided certificate.

      This method doesn't always require complete extension value equality, instead whenever possible it checks that this extension is present in the certificate.

      Parameters:
      certificate - X509Certificate in which this extension shall be present
      Returns:
      true if extension if present, false otherwise
    • equals

      public boolean equals (Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object