Class KeyUsageExtension
java.lang.Object
com.itextpdf.signatures.validation.extensions.CertificateExtension
com.itextpdf.signatures.validation.extensions.KeyUsageExtension
Class representing "Key Usage" extenstion.
-
Constructor Summary
ConstructorDescriptionKeyUsageExtension
(int keyUsage) Create newKeyUsageExtension
instance using providedint
flag.KeyUsageExtension
(KeyUsage keyUsageValue) Create newKeyUsageExtension
instance using provided single key usage enum value.KeyUsageExtension
(List<KeyUsage> keyUsages) Create newKeyUsageExtension
instance using provided key usage enum list. -
Method Summary
Modifier and TypeMethodDescriptionboolean
existsInCertificate
(X509Certificate certificate) Check if this extension is present in the provided certificate.Methods inherited from class com.itextpdf.signatures.validation.extensions.CertificateExtension
equals, getExtensionOid, getExtensionValue, hashCode
-
Constructor Details
-
KeyUsageExtension
public KeyUsageExtension(int keyUsage) Create newKeyUsageExtension
instance using providedint
flag.- Parameters:
-
keyUsage
-int
flag which represents bit values for key usage value
-
KeyUsageExtension
Create newKeyUsageExtension
instance using provided key usage enum list.- Parameters:
-
keyUsages
- key usagesList
which represents key usage values
-
KeyUsageExtension
Create newKeyUsageExtension
instance using provided single key usage enum value.- Parameters:
-
keyUsageValue
-KeyUsage
which represents single key usage enum value
-
-
Method Details
-
existsInCertificate
Check if this extension is present in the provided certificate. In case ofKeyUsageExtension
, check if this key usage bit values are present in certificate. Other values may be present as well.- Overrides:
-
existsInCertificate
in classCertificateExtension
- Parameters:
-
certificate
-X509Certificate
in which this extension shall be present - Returns:
-
true
if this key usage bit values are present in certificate,false
otherwise
-