Enum KeyUsageBits

java.lang.Object
java.lang.Enum<KeyUsageBits>
org.cryptacular.x509.KeyUsageBits
All Implemented Interfaces:
Serializable, Comparable<KeyUsageBits>, java.lang.constant.Constable

public enum KeyUsageBits extends Enum<KeyUsageBits>
Representation of the bit meanings in the KeyUsage BIT STRING type defined in section 4.2.1.3 of RFC 2459.
Version:
$Revision: 2745 $
Author:
Middleware Services
  • Enum Constant Details

    • DigitalSignature

      public static final KeyUsageBits DigitalSignature
      digitalSignature bit.
    • NonRepudiation

      public static final KeyUsageBits NonRepudiation
      nonRepudiation bit.
    • KeyEncipherment

      public static final KeyUsageBits KeyEncipherment
      keyEncipherment bit.
    • DataEncipherment

      public static final KeyUsageBits DataEncipherment
      dataEncipherment bit.
    • KeyAgreement

      public static final KeyUsageBits KeyAgreement
      keyAgreement bit.
    • KeyCertSign

      public static final KeyUsageBits KeyCertSign
      keyCertSign bit.
    • CRLSign

      public static final KeyUsageBits CRLSign
      cRLSign bit.
    • EncipherOnly

      public static final KeyUsageBits EncipherOnly
      encipherOnly bit.
    • DecipherOnly

      public static final KeyUsageBits DecipherOnly
      decipherOnly bit.
  • Method Details

    • values

      public static KeyUsageBits[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static KeyUsageBits valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getMask

      public int getMask()
      Returns:
      Bit mask value.
    • isSet

      public boolean isSet(org.bouncycastle.asn1.x509.KeyUsage keyUsage)
      Determines whether this key usage bit is set in the given key usage value.
      Parameters:
      keyUsage - BC key usage object.
      Returns:
      True if bit is set, false otherwise.
    • isSet

      public boolean isSet(byte[] bitString)
      Determines whether this key usage bit is set in the given key usage bit string.
      Parameters:
      bitString - Key usage bit string as a byte array.
      Returns:
      True if bit is set, false otherwise.
    • isSet

      public boolean isSet(int bitString)
      Determines whether this key usage bit is set in the given key usage bit string.
      Parameters:
      bitString - Key usage bit string as a big endian integer.
      Returns:
      True if bit is set, false otherwise.
    • usage

      public static int usage(KeyUsageBits... bits)
      Computes the key usage value from one or more key usage bits.
      Parameters:
      bits - One ore more key usage bits.
      Returns:
      Key usage bit string as an integer.