Enum Class KeyOperation

java.lang.Object
java.lang.Enum<KeyOperation>
org.forgerock.json.jose.jwk.KeyOperation
All Implemented Interfaces:
Serializable, Comparable<KeyOperation>, java.lang.constant.Constable

public enum KeyOperation extends Enum<KeyOperation>
Represents the Possible key operations values.
  • Enum Constant Details

    • SIGN

      public static final KeyOperation SIGN
      Use Key to compute digital signature or MAC.
    • VERIFY

      public static final KeyOperation VERIFY
      Use Key to verify digital signature or MAC.
    • ENCRYPT

      public static final KeyOperation ENCRYPT
      Use Key to encrypt content.
    • DECRYPT

      public static final KeyOperation DECRYPT
      Use Key to decrypt content and validate decryption, if applicable.
    • WRAP_KEY

      public static final KeyOperation WRAP_KEY
      Use Key to encrypt key.
    • UNWRAP_KEY

      public static final KeyOperation UNWRAP_KEY
      Use Key to decrypt key and validate decryption, if applicable.
    • DERIVE_KEY

      public static final KeyOperation DERIVE_KEY
      Use Key to derive key.
    • DERIVE_BITS

      public static final KeyOperation DERIVE_BITS
      Use Key to derive bits not to be used as a key.
  • Method Details

    • values

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

      public static KeyOperation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
      Get the Value of the KeyOperation.
      Returns:
      the KeyOperation value.
    • getKeyOperations

      public static KeyOperation getKeyOperations(String name)
      Get the KeyOperation. The key operation values are case-sensitive strings.
      Parameters:
      name - the string representing the KeyOperation to get
      Returns:
      a KeyOperation, or null if KeyOperation is null or empty
    • toString

      public String toString()
      Prints the KeyOperation value.
      Overrides:
      toString in class Enum<KeyOperation>
      Returns:
      the KeyOperation in lowercase