Enum KeyOperation

    • Enum Constant Detail

      • 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 Detail

      • values

        public static KeyOperation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (KeyOperation c : KeyOperation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static KeyOperation 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
      • 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