Package org.forgerock.json.jose.jwe
Enum EncryptionMethod
- All Implemented Interfaces:
Serializable
,Comparable<EncryptionMethod>
An Enum of the possible encryption methods that can be used when encrypting a JWT.
- Since:
- 2.0.0
- See Also:
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAES encryption in CBC mode with PKCS5 Padding and a 128 bit length, AES encryption for CEK, HMAC using SHA-256 hash algorithm for authentication tag.AES encryption in Galois Counter Mode (GCM) with a 128 bit key length.AES encryption in CBC mode with PKCS5 Padding and a 192 bit length, AES encryption for CEK, HMAC using SHA-384 hash algorithm for the authentication tag.AES encryption in Galois Counter Mode (GCM) with a 192 bit key length.AES encryption in CBC mode with PKCS5 Padding and a 256 bit length, AES encryption for CEK, HMAC using SHA-256 hash algorithm for authentication tag.AES encryption in Galois Counter Mode (GCM) with a 256 bit key length. -
Method Summary
Modifier and TypeMethodDescriptionGets the Java Cryptographic algorithm name for the algorithm that will create the Content Encryption Key (CEK).int
Gets the number of octets in each of the CEK and MAC key.int
Gets the bit length of the Content Encryption Key (CEK).Gets the Java Cryptographic algorithm name for the algorithm that will generate the MAC key.getName()
Gets the full name of the encryption method.Gets the Java Cryptographic algorithm name for the algorithm that will eb used to encrypt the plaintext.static EncryptionMethod
parseMethod
(String method) Parses the given algorithm string to find the matching EncryptionMethod enum constant.toString()
Turns the EncryptionMethod constant into a JSON value string.static EncryptionMethod
Returns the enum constant of this type with the specified name.static EncryptionMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
A128CBC_HS256
AES encryption in CBC mode with PKCS5 Padding and a 128 bit length, AES encryption for CEK, HMAC using SHA-256 hash algorithm for authentication tag. -
A192CBC_HS384
AES encryption in CBC mode with PKCS5 Padding and a 192 bit length, AES encryption for CEK, HMAC using SHA-384 hash algorithm for the authentication tag. -
A256CBC_HS512
AES encryption in CBC mode with PKCS5 Padding and a 256 bit length, AES encryption for CEK, HMAC using SHA-256 hash algorithm for authentication tag. -
A128GCM
AES encryption in Galois Counter Mode (GCM) with a 128 bit key length. -
A192GCM
AES encryption in Galois Counter Mode (GCM) with a 192 bit key length. -
A256GCM
AES encryption in Galois Counter Mode (GCM) with a 256 bit key length.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
Gets the full name of the encryption method.- Returns:
- The name of the encryption method.
-
getTransformation
Gets the Java Cryptographic algorithm name for the algorithm that will eb used to encrypt the plaintext.- Returns:
- The transformation algorithm.
-
getMacAlgorithm
Gets the Java Cryptographic algorithm name for the algorithm that will generate the MAC key.- Returns:
- The mac algorithm.
-
getEncryptionAlgorithm
Gets the Java Cryptographic algorithm name for the algorithm that will create the Content Encryption Key (CEK).- Returns:
- The encryption algorithm.
-
getKeyOffset
Gets the number of octets in each of the CEK and MAC key.- Returns:
- The Key Offset.
-
getKeySize
Gets the bit length of the Content Encryption Key (CEK).- Returns:
- The key size.
-
parseMethod
Parses the given algorithm string to find the matching EncryptionMethod enum constant.- Parameters:
method
- The encryption method.- Returns:
- The EncryptionMethod enum.
-
toString
Turns the EncryptionMethod constant into a JSON value string.- Overrides:
toString
in classEnum<EncryptionMethod>
- Returns:
-