Class KeyUsage

  • All Implemented Interfaces:
    java.io.Serializable

    public class KeyUsage
    extends java.lang.Object
    implements java.io.Serializable

    Class 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.
    • Constructor Detail

      • KeyUsage

        public KeyUsage()
        Constructor method for the class KeyUsage.java.
    • 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:
        true if there is at least one key usage bit, otherwise false.
      • 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:
        true if the input parameter not is null and 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:
        true if the input certificate has the same key usage set that this object, otherwise false.