Class KeyUsage
- java.lang.Object
-
- es.gob.afirma.tsl.parsing.impl.common.extensions.KeyUsage
-
- All Implemented Interfaces:
java.io.Serializable
public class KeyUsage extends java.lang.Object implements java.io.SerializableClass that provides a list of key usage bit-values to match with the correspondent bits present in the keyUsage certificate Extension. The assertion is verified if the KeyUsage Extension is present in the certificate and all key usage bits provided are matched with the corresponding bit in the certificate KeyUsage Extension.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.1, 15/06/2021.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyUsage()Constructor method for the class KeyUsage.java.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddNewKeyUsageBit(KeyUsageBit kub)Adds a new Key Usage Bit to the list if there is free space.booleancheckCertificate(java.security.cert.X509Certificate cert)Checks if the input certificate has the same key usage set that this object.java.util.List<KeyUsageBit>getKeyUsageBitList()Gets the key usage bit list.booleanisThereSomeKeyUsageBit()Checks if there is at least one key usage bit.
-
-
-
Method Detail
-
getKeyUsageBitList
public final java.util.List<KeyUsageBit> getKeyUsageBitList()
Gets the key usage bit list.- Returns:
- Key Usage Bit List.
-
isThereSomeKeyUsageBit
public final boolean isThereSomeKeyUsageBit()
Checks if there is at least one key usage bit.- Returns:
trueif there is at least one key usage bit, otherwisefalse.
-
addNewKeyUsageBit
public final boolean addNewKeyUsageBit(KeyUsageBit kub)
Adds a new Key Usage Bit to the list if there is free space.- Parameters:
kub- Key Usage Bit to add.- Returns:
trueif the input parameter not isnulland there is free space in the list, otherwise false.
-
checkCertificate
public final boolean checkCertificate(java.security.cert.X509Certificate cert)
Checks if the input certificate has the same key usage set that this object.- Parameters:
cert- Certificate to check.- Returns:
trueif the input certificate has the same key usage set that this object, otherwisefalse.
-
-