Package com.nimbusds.jose.jwk
Enum KeyOperation
- java.lang.Object
-
- java.lang.Enum<KeyOperation>
-
- com.nimbusds.jose.jwk.KeyOperation
-
- All Implemented Interfaces:
Serializable
,Comparable<KeyOperation>
public enum KeyOperation extends Enum<KeyOperation>
Enumeration of key operations. Represents thekey_ops
parameter in a JSON Web Key (JWK).JWK operation values:
- Version:
- 2014-04-02
- Author:
- Vladimir Dzhuvinov
-
-
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 String
identifier()
Returns the identifier of this public key use.static Set<KeyOperation>
parse(List<String> sl)
Parses a key operation set from the specified JWKkey_ops
parameter value.String
toString()
static KeyOperation
valueOf(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.
-
-
-
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(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 nameNullPointerException
- if the argument is null
-
identifier
public String identifier()
Returns the identifier of this public key use.- Returns:
- The identifier.
-
toString
public String toString()
- Overrides:
toString
in classEnum<KeyOperation>
- See Also:
identifier()
-
parse
public static Set<KeyOperation> parse(List<String> sl) throws ParseException
Parses a key operation set from the specified JWKkey_ops
parameter value.- Parameters:
sl
- The string list to parse. May benull
.- Returns:
- The key operation set,
null
if none. - Throws:
ParseException
- If the string list couldn't be parsed to a valid key operation list.
-
-