Class ExtendedKeyUsageExtension
- java.lang.Object
-
- com.itextpdf.signatures.validation.extensions.CertificateExtension
-
- com.itextpdf.signatures.validation.extensions.ExtendedKeyUsageExtension
-
public class ExtendedKeyUsageExtension extends CertificateExtension
Class representing "Extended Key Usage" extension.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTUALstatic java.lang.StringANY_EXTENDED_KEY_USAGE_OIDstatic java.lang.StringCLIENT_AUTHstatic java.lang.StringCODE_SIGNINGstatic java.lang.StringERROR_OCCURRED_DURING_RETRIEVALprivate java.lang.StringerrorMessagestatic java.lang.StringEXPECTED_KEY_USAGESprivate java.util.List<java.lang.String>extendedKeyUsageOidsprivate static IBouncyCastleFactoryFACTORYstatic java.lang.StringNO_EXTENDED_KEY_USAGES_WERE_FOUNDstatic java.lang.StringOCSP_SIGNINGstatic java.lang.StringTIME_STAMPING-
Fields inherited from class com.itextpdf.signatures.validation.extensions.CertificateExtension
EXCEPTION_OCCURRED, EXPECTED_EXTENSION_ID_AND_VALUE, EXTENSION_NOT_FOUND, FOUND_VALUE
-
-
Constructor Summary
Constructors Constructor Description ExtendedKeyUsageExtension(java.util.List<java.lang.String> extendedKeyUsageOids)Create newExtendedKeyUsageExtensioninstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static IKeyPurposeId[]createKeyPurposeIds(java.util.List<java.lang.String> extendedKeyUsageOids)booleanexistsInCertificate(java.security.cert.X509Certificate certificate)Check if this extension is present in the provided certificate.java.lang.StringgetMessage()Returns a message with extra information about the check.-
Methods inherited from class com.itextpdf.signatures.validation.extensions.CertificateExtension
equals, getExtensionOid, getExtensionValue, hashCode
-
-
-
-
Field Detail
-
ANY_EXTENDED_KEY_USAGE_OID
public static final java.lang.String ANY_EXTENDED_KEY_USAGE_OID
- See Also:
- Constant Field Values
-
TIME_STAMPING
public static final java.lang.String TIME_STAMPING
- See Also:
- Constant Field Values
-
OCSP_SIGNING
public static final java.lang.String OCSP_SIGNING
- See Also:
- Constant Field Values
-
CODE_SIGNING
public static final java.lang.String CODE_SIGNING
- See Also:
- Constant Field Values
-
CLIENT_AUTH
public static final java.lang.String CLIENT_AUTH
- See Also:
- Constant Field Values
-
FACTORY
private static final IBouncyCastleFactory FACTORY
-
EXPECTED_KEY_USAGES
public static final java.lang.String EXPECTED_KEY_USAGES
- See Also:
- Constant Field Values
-
ACTUAL
public static final java.lang.String ACTUAL
- See Also:
- Constant Field Values
-
NO_EXTENDED_KEY_USAGES_WERE_FOUND
public static final java.lang.String NO_EXTENDED_KEY_USAGES_WERE_FOUND
- See Also:
- Constant Field Values
-
ERROR_OCCURRED_DURING_RETRIEVAL
public static final java.lang.String ERROR_OCCURRED_DURING_RETRIEVAL
- See Also:
- Constant Field Values
-
extendedKeyUsageOids
private final java.util.List<java.lang.String> extendedKeyUsageOids
-
errorMessage
private java.lang.String errorMessage
-
-
Constructor Detail
-
ExtendedKeyUsageExtension
public ExtendedKeyUsageExtension(java.util.List<java.lang.String> extendedKeyUsageOids)
Create newExtendedKeyUsageExtensioninstance.- Parameters:
extendedKeyUsageOids- stringsList, representing extended key usages OIDs
-
-
Method Detail
-
existsInCertificate
public boolean existsInCertificate(java.security.cert.X509Certificate certificate)
Check if this extension is present in the provided certificate. In case ofExtendedKeyUsageExtension, check if this extended key usage OIDs are present. Other values may be present as well.- Overrides:
existsInCertificatein classCertificateExtension- Parameters:
certificate-X509Certificatein which this extension shall be present- Returns:
trueif all OIDs are present in certificate extension,falseotherwise
-
createKeyPurposeIds
private static IKeyPurposeId[] createKeyPurposeIds(java.util.List<java.lang.String> extendedKeyUsageOids)
-
getMessage
public java.lang.String getMessage()
Description copied from class:CertificateExtensionReturns a message with extra information about the check.- Overrides:
getMessagein classCertificateExtension- Returns:
- a message with extra information about the check.
-
-