Class KeyUsageBit
- java.lang.Object
-
- es.gob.afirma.tsl.parsing.impl.common.extensions.KeyUsageBit
-
- All Implemented Interfaces:
java.io.Serializable
public class KeyUsageBit extends java.lang.Object implements java.io.SerializableClass that represents a Key Usage Bit Identifier.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.1, 15/06/2021.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME_CRLSIGNConstant attribute that represents the key usage name 'crlSign'.static java.lang.StringNAME_DATAENCIPHERMENTConstant attribute that represents the key usage name 'dataEncipherment'.static java.lang.StringNAME_DECIPHERONLYConstant attribute that represents the key usage name 'decipherOnly'.static java.lang.StringNAME_DIGITALSIGNATUREConstant attribute that represents the key usage name 'digitalSignature'.static java.lang.StringNAME_ENCIPHERONLYConstant attribute that represents the key usage name 'encipherOnly'.static java.lang.StringNAME_KEYAGREEMENTConstant attribute that represents the key usage name 'keyAgreement'.static java.lang.StringNAME_KEYCERTSIGNConstant attribute that represents the key usage name 'keyCertSign'.static java.lang.StringNAME_KEYENCIPHERMENTConstant attribute that represents the key usage name 'keyEncipherment'.static java.lang.StringNAME_NONREPUDATIONConstant attribute that represents the key usage name 'nonRepudiation'.
-
Constructor Summary
Constructors Constructor Description KeyUsageBit(java.lang.String keyUsageName, boolean keyUsageValue)Constructor method for the class KeyUsageBit.java.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckCertificate(java.security.cert.X509Certificate cert)Checks if the input certificate has the KeyUsage set to the same value how this object.java.lang.StringgetName()Gets the value of the attributename.booleangetValue()Gets the value of the attributevalue.voidsetKeyUsage(java.lang.String keyUsageName, boolean keyUsageValue)Sets the Key Usage.
-
-
-
Field Detail
-
NAME_DIGITALSIGNATURE
public static final java.lang.String NAME_DIGITALSIGNATURE
Constant attribute that represents the key usage name 'digitalSignature'.- See Also:
- Constant Field Values
-
NAME_NONREPUDATION
public static final java.lang.String NAME_NONREPUDATION
Constant attribute that represents the key usage name 'nonRepudiation'.- See Also:
- Constant Field Values
-
NAME_KEYENCIPHERMENT
public static final java.lang.String NAME_KEYENCIPHERMENT
Constant attribute that represents the key usage name 'keyEncipherment'.- See Also:
- Constant Field Values
-
NAME_DATAENCIPHERMENT
public static final java.lang.String NAME_DATAENCIPHERMENT
Constant attribute that represents the key usage name 'dataEncipherment'.- See Also:
- Constant Field Values
-
NAME_KEYAGREEMENT
public static final java.lang.String NAME_KEYAGREEMENT
Constant attribute that represents the key usage name 'keyAgreement'.- See Also:
- Constant Field Values
-
NAME_KEYCERTSIGN
public static final java.lang.String NAME_KEYCERTSIGN
Constant attribute that represents the key usage name 'keyCertSign'.- See Also:
- Constant Field Values
-
NAME_CRLSIGN
public static final java.lang.String NAME_CRLSIGN
Constant attribute that represents the key usage name 'crlSign'.- See Also:
- Constant Field Values
-
NAME_ENCIPHERONLY
public static final java.lang.String NAME_ENCIPHERONLY
Constant attribute that represents the key usage name 'encipherOnly'.- See Also:
- Constant Field Values
-
NAME_DECIPHERONLY
public static final java.lang.String NAME_DECIPHERONLY
Constant attribute that represents the key usage name 'decipherOnly'.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public final java.lang.String getName()
Gets the value of the attributename.- Returns:
- the value of the attribute
name.
-
getValue
public final boolean getValue()
Gets the value of the attributevalue.- Returns:
- the value of the attribute
value.
-
setKeyUsage
public final void setKeyUsage(java.lang.String keyUsageName, boolean keyUsageValue)Sets the Key Usage.- Parameters:
keyUsageName- Key Usage name to assign.keyUsageValue- Key usage value to assign.
-
checkCertificate
public final boolean checkCertificate(java.security.cert.X509Certificate cert)
Checks if the input certificate has the KeyUsage set to the same value how this object.- Parameters:
cert- Certificate X509v3 to check.- Returns:
trueif the certificate has the KeyUsage set to the same value how this object, otherwisefalse.
-
-