Class KeyUsageExtension

java.lang.Object
com.itextpdf.signatures.validation.v1.extensions.CertificateExtension
com.itextpdf.signatures.validation.v1.extensions.KeyUsageExtension

public class KeyUsageExtension extends CertificateExtension
Class representing "Key Usage" extenstion.
  • Constructor Details

    • KeyUsageExtension

      public KeyUsageExtension (int keyUsage)
      Create new KeyUsageExtension instance using provided int flag.
      Parameters:
      keyUsage - int flag which represents bit values for key usage value
    • KeyUsageExtension

      public KeyUsageExtension (List<KeyUsage> keyUsages)
      Create new KeyUsageExtension instance using provided key usage enum list.
      Parameters:
      keyUsages - key usages List which represents key usage values
    • KeyUsageExtension

      public KeyUsageExtension (KeyUsage keyUsageValue)
      Create new KeyUsageExtension instance using provided single key usage enum value.
      Parameters:
      keyUsageValue - KeyUsage which represents single key usage enum value
  • Method Details

    • existsInCertificate

      public boolean existsInCertificate (X509Certificate certificate)
      Check if this extension is present in the provided certificate. In case of KeyUsageExtension, check if this key usage bit values are present in certificate. Other values may be present as well.
      Overrides:
      existsInCertificate in class CertificateExtension
      Parameters:
      certificate - X509Certificate in which this extension shall be present
      Returns:
      true if this key usage bit values are present in certificate, false otherwise