Package org.forgerock.json.jose.jwe
Enum JweAlgorithm
- All Implemented Interfaces:
Serializable
,Comparable<JweAlgorithm>
,Algorithm
An Enum of the possible encryption algorithms that can be used to encrypt a JWT.
- Since:
- 2.0.0
- See Also:
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAES-128 KeyWrap.AES-192 KeyWrap.AES-256 KeyWrap.Direct encryption with a shared symmetric key.RSA in ECB mode with OAEP with SHA-1 and MGF1 padding.RSA in ECB mode with OAEP with SHA-256 and MGF1 with SHA-256 padding.RSA in ECB mode with PKCS1 Padding. -
Method Summary
Modifier and TypeMethodDescriptionGets the actual name of the algorithm that is understood by Java cryptographic operations.Gets the JweAlgorithmType of the JweAlgorithm.Gets the name of the algorithm as defined in the JWA standard.static JweAlgorithm
parseAlgorithm
(String algorithm) Parses the given algorithm string to find the matching EncryptionMethod enum constant.toString()
Turns the JweAlgorithm constant into a JSON value string.static JweAlgorithm
Returns the enum constant of this type with the specified name.static JweAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
RSAES_PKCS1_V1_5
RSA in ECB mode with PKCS1 Padding. -
RSA_OAEP
RSA in ECB mode with OAEP with SHA-1 and MGF1 padding. -
RSA_OAEP_256
RSA in ECB mode with OAEP with SHA-256 and MGF1 with SHA-256 padding. -
DIRECT
Direct encryption with a shared symmetric key. -
A128KW
AES-128 KeyWrap. -
A192KW
AES-192 KeyWrap. -
A256KW
AES-256 KeyWrap.
-
-
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
-
getAlgorithm
Description copied from interface:Algorithm
Gets the actual name of the algorithm that is understood by Java cryptographic operations.- Specified by:
getAlgorithm
in interfaceAlgorithm
- Returns:
- The name of the algorithm.
-
getJwaAlgorithmName
Description copied from interface:Algorithm
Gets the name of the algorithm as defined in the JWA standard.- Specified by:
getJwaAlgorithmName
in interfaceAlgorithm
- Returns:
- The name of the algorithm.
-
getAlgorithmType
Gets the JweAlgorithmType of the JweAlgorithm.- Returns:
- The JweAlgorithmType.
-
parseAlgorithm
Parses the given algorithm string to find the matching EncryptionMethod enum constant.- Parameters:
algorithm
- The encryption algorithm.- Returns:
- The JweAlgorithm enum.
-
toString
Turns the JweAlgorithm constant into a JSON value string.- Overrides:
toString
in classEnum<JweAlgorithm>
- Returns:
-