Enum KeyOperation

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DECRYPT
      Decrypt content and validate decryption, if applicable.
      DERIVE_BITS
      Derive bits not to be used as a key.
      DERIVE_KEY
      Derive key.
      ENCRYPT
      Encrypt content.
      SIGN
      Compute signature or MAC.
      UNWRAP_KEY
      Decrypt key and validate decryption, if applicable.
      VERIFY
      Verify signature or MAC.
      WRAP_KEY
      Encrypt key.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String identifier()
      Returns the identifier of this public key use.
      static java.util.Set<KeyOperation> parse​(java.util.List<java.lang.String> sl)
      Parses a key operation set from the specified JWK key_ops parameter value.
      java.lang.String toString()  
      static KeyOperation valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static KeyOperation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • SIGN

        public static final KeyOperation SIGN
        Compute signature or MAC.
      • VERIFY

        public static final KeyOperation VERIFY
        Verify signature or MAC.
      • ENCRYPT

        public static final KeyOperation ENCRYPT
        Encrypt content.
      • DECRYPT

        public static final KeyOperation DECRYPT
        Decrypt content and validate decryption, if applicable.
      • WRAP_KEY

        public static final KeyOperation WRAP_KEY
        Encrypt key.
      • UNWRAP_KEY

        public static final KeyOperation UNWRAP_KEY
        Decrypt key and validate decryption, if applicable.
      • DERIVE_KEY

        public static final KeyOperation DERIVE_KEY
        Derive key.
      • DERIVE_BITS

        public static final KeyOperation DERIVE_BITS
        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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • identifier

        public java.lang.String identifier()
        Returns the identifier of this public key use.
        Returns:
        The identifier.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<KeyOperation>
        See Also:
        identifier()
      • parse

        public static java.util.Set<KeyOperation> parse​(java.util.List<java.lang.String> sl)
                                                 throws java.text.ParseException
        Parses a key operation set from the specified JWK key_ops parameter value.
        Parameters:
        sl - The string list to parse. May be null.
        Returns:
        The key operation set, null if none.
        Throws:
        java.text.ParseException - If the string list couldn't be parsed to a valid key operation list.