Package com.authlete.common.types
Enum JWEEnc
- java.lang.Object
-
- java.lang.Enum<JWEEnc>
-
- com.authlete.common.types.JWEEnc
-
- All Implemented Interfaces:
Serializable
,Comparable<JWEEnc>
public enum JWEEnc extends Enum<JWEEnc>
"enc"
(Encryption Algorithm) Header Parameter Values for JWE.- Author:
- Takahiko Kawasaki
- See Also:
- RFC 7518, 5.1. "enc" (Encryption Algorithm) Header Parameter Values for JWE
-
-
Enum Constant Summary
Enum Constants Enum Constant Description A128CBC_HS256
"A128CBC-HS256"
(1); Algorithm defined in 5.2.3. AES_128_CBC_HMAC_SHA_256 in RFC 7518.A128GCM
"A128GCM"
(4); AES GCM using 128 bit key.A192CBC_HS384
"A192CBC-HS384"
(2); Algorithm defined in 5.2.4. AES_192_CBC_HMAC_SHA_384 in RFC 7518.A192GCM
"A192GCM"
(5); AES GCM using 192 bit key.A256CBC_HS512
"A256CBC-HS512"
(3); Algorithm defined in 5.2.5. AES_256_CBC_HMAC_SHA_512 in RFC 7518.A256GCM
"A256GCM"
(6); AES GCM using 256 bit key.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JWEEnc
getByValue(short value)
Find an instance of this enum by a value.String
getName()
Get the name of this encryption method.short
getValue()
Get the integer representation of this enum instance.static JWEEnc
parse(String alg)
ConvertString
toJWEEnc
.static JWEEnc[]
toArray(int bits)
static int
toBits(EnumSet<JWEEnc> set)
static EnumSet<JWEEnc>
toSet(int bits)
static EnumSet<JWEEnc>
toSet(JWEEnc[] array)
String
toString()
static JWEEnc
valueOf(String name)
Returns the enum constant of this type with the specified name.static JWEEnc[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
A128CBC_HS256
public static final JWEEnc A128CBC_HS256
"A128CBC-HS256"
(1); Algorithm defined in 5.2.3. AES_128_CBC_HMAC_SHA_256 in RFC 7518.
-
A192CBC_HS384
public static final JWEEnc A192CBC_HS384
"A192CBC-HS384"
(2); Algorithm defined in 5.2.4. AES_192_CBC_HMAC_SHA_384 in RFC 7518.
-
A256CBC_HS512
public static final JWEEnc A256CBC_HS512
"A256CBC-HS512"
(3); Algorithm defined in 5.2.5. AES_256_CBC_HMAC_SHA_512 in RFC 7518.
-
A128GCM
public static final JWEEnc A128GCM
"A128GCM"
(4); AES GCM using 128 bit key.
-
A192GCM
public static final JWEEnc A192GCM
"A192GCM"
(5); AES GCM using 192 bit key.
-
A256GCM
public static final JWEEnc A256GCM
"A256GCM"
(6); AES GCM using 256 bit key.
-
-
Method Detail
-
values
public static JWEEnc[] 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 (JWEEnc c : JWEEnc.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JWEEnc 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
-
getName
public String getName()
Get the name of this encryption method. One of the values listed in the table in 5.1. "enc" (Encryption Algorithm) Header Parameter Values for JWE of RFC 7518 is returned.- Returns:
- The name of this encryption method.
- Since:
- 2.17
-
getValue
public short getValue()
Get the integer representation of this enum instance.
-
getByValue
public static JWEEnc getByValue(short value)
Find an instance of this enum by a value.- Parameters:
value
- The integer representation of the instance to find.- Returns:
- An instance of this enum, or
null
if not found.
-
parse
public static JWEEnc parse(String alg)
ConvertString
toJWEEnc
.- Parameters:
alg
- Algorithm name. For example,"A128CBC-HS256"
.- Returns:
JWEEnc
instance, ornull
.
-
toArray
public static JWEEnc[] toArray(int bits)
-
-