Package com.nimbusds.jose
Class JWEAlgorithm
- java.lang.Object
-
- com.nimbusds.jose.Algorithm
-
- com.nimbusds.jose.JWEAlgorithm
-
- All Implemented Interfaces:
Serializable
@Immutable public final class JWEAlgorithm extends Algorithm
JSON Web Encryption (JWE) algorithm name, represents thealg
header parameter in JWE objects. This class is immutable.Includes constants for the following JWE algorithm names:
RSA-OAEP-256
RSA-OAEP-384
RSA-OAEP-512
RSA-OAEP
(deprecated)RSA1_5
(deprecated)A128KW
A192KW
A256KW
dir
ECDH-ES
ESDH-ES+A128KW
ESDH-ES+A192KW
ESDH-ES+A256KW
ECDH-1PU
ESDH-1PU+A128KW
ESDH-1PU+A192KW
ESDH-1PU+A256KW
PBES2-HS256+A128KW
PBES2-HS256+A192KW
PBES2-HS256+A256KW
Additional JWE algorithm names can be defined using the constructors.
- Version:
- 2023-09-13
- Author:
- Vladimir Dzhuvinov
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JWEAlgorithm.Family
JWE algorithm family.
-
Field Summary
Fields Modifier and Type Field Description static JWEAlgorithm
A128GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 128 bit keys.static JWEAlgorithm
A128KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 128 bit keys.static JWEAlgorithm
A192GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 192 bit keys.static JWEAlgorithm
A192KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 192 bit keys.static JWEAlgorithm
A256GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 256 bit keys.static JWEAlgorithm
A256KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys.static JWEAlgorithm
DIR
Direct use of a shared symmetric key as the Content Encryption Key (CEK) for the block encryption step (rather than using the symmetric key to wrap the CEK).static JWEAlgorithm
ECDH_1PU
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement using the Concat KDF, as defined in section 5.8.1 of NIST.800-56A, with the agreed-upon key being used directly as the Content Encryption Key (CEK) (rather than being used to wrap the CEK).static JWEAlgorithm
ECDH_1PU_A128KW
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement per "ECDH-1PU", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A128KW" function (rather than being used directly as the CEK).static JWEAlgorithm
ECDH_1PU_A192KW
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement per "ECDH-1PU", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A192KW" function (rather than being used directly as the CEK).static JWEAlgorithm
ECDH_1PU_A256KW
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement per "ECDH-1PU", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A256KW" function (rather than being used directly as the CEK).static JWEAlgorithm
ECDH_ES
Elliptic Curve Diffie-Hellman Ephemeral Static (RFC 6090) key agreement using the Concat KDF, as defined in section 5.8.1 of NIST.800-56A, with the agreed-upon key being used directly as the Content Encryption Key (CEK) (rather than being used to wrap the CEK).static JWEAlgorithm
ECDH_ES_A128KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A128KW" function (rather than being used directly as the CEK).static JWEAlgorithm
ECDH_ES_A192KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A192KW" function (rather than being used directly as the CEK).static JWEAlgorithm
ECDH_ES_A256KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A256KW" function (rather than being used directly as the CEK).static JWEAlgorithm
PBES2_HS256_A128KW
PBES2 (RFC 2898) with HMAC SHA-256 as the PRF and AES Key Wrap (RFC 3394) using 128 bit keys for the encryption scheme.static JWEAlgorithm
PBES2_HS384_A192KW
PBES2 (RFC 2898) with HMAC SHA-384 as the PRF and AES Key Wrap (RFC 3394) using 192 bit keys for the encryption scheme.static JWEAlgorithm
PBES2_HS512_A256KW
PBES2 (RFC 2898) with HMAC SHA-512 as the PRF and AES Key Wrap (RFC 3394) using 256 bit keys for the encryption scheme.static JWEAlgorithm
RSA_OAEP
Deprecated.static JWEAlgorithm
RSA_OAEP_256
RSAES using Optimal Asymmetric Encryption Padding (OAEP) (RFC 3447), with the SHA-256 hash function and the MGF1 with SHA-256 mask generation function.static JWEAlgorithm
RSA_OAEP_384
RSAES using Optimal Asymmetric Encryption Padding (OAEP) (RFC 3447), with the SHA-512 hash function and the MGF1 with SHA-384 mask generation function.static JWEAlgorithm
RSA_OAEP_512
RSAES using Optimal Asymmetric Encryption Padding (OAEP) (RFC 3447), with the SHA-512 hash function and the MGF1 with SHA-512 mask generation function.static JWEAlgorithm
RSA1_5
Deprecated.
-
Constructor Summary
Constructors Constructor Description JWEAlgorithm(String name)
Creates a new JSON Web Encryption (JWE) algorithm.JWEAlgorithm(String name, Requirement req)
Creates a new JSON Web Encryption (JWE) algorithm.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JWEAlgorithm
parse(String s)
Parses a JWE algorithm from the specified string.-
Methods inherited from class com.nimbusds.jose.Algorithm
equals, getName, getRequirement, hashCode, toJSONString, toString
-
-
-
-
Field Detail
-
RSA1_5
@Deprecated public static final JWEAlgorithm RSA1_5
Deprecated.RSAES-PKCS1-V1_5 (RFC 3447). Use of this RSA encryption algorithm is no longer recommended, useRSA_OAEP_256
instead.
-
RSA_OAEP
@Deprecated public static final JWEAlgorithm RSA_OAEP
Deprecated.RSAES using Optimal Asymmetric Encryption Padding (OAEP) (RFC 3447), with the default parameters specified by RFC 3447 in section A.2.1. Use of this encryption algorithm is no longer recommended, useRSA_OAEP_256
instead.
-
RSA_OAEP_256
public static final JWEAlgorithm RSA_OAEP_256
RSAES using Optimal Asymmetric Encryption Padding (OAEP) (RFC 3447), with the SHA-256 hash function and the MGF1 with SHA-256 mask generation function.
-
RSA_OAEP_384
public static final JWEAlgorithm RSA_OAEP_384
RSAES using Optimal Asymmetric Encryption Padding (OAEP) (RFC 3447), with the SHA-512 hash function and the MGF1 with SHA-384 mask generation function.
-
RSA_OAEP_512
public static final JWEAlgorithm RSA_OAEP_512
RSAES using Optimal Asymmetric Encryption Padding (OAEP) (RFC 3447), with the SHA-512 hash function and the MGF1 with SHA-512 mask generation function.
-
A128KW
public static final JWEAlgorithm A128KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 128 bit keys.
-
A192KW
public static final JWEAlgorithm A192KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 192 bit keys.
-
A256KW
public static final JWEAlgorithm A256KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys.
-
DIR
public static final JWEAlgorithm DIR
Direct use of a shared symmetric key as the Content Encryption Key (CEK) for the block encryption step (rather than using the symmetric key to wrap the CEK).
-
ECDH_ES
public static final JWEAlgorithm ECDH_ES
Elliptic Curve Diffie-Hellman Ephemeral Static (RFC 6090) key agreement using the Concat KDF, as defined in section 5.8.1 of NIST.800-56A, with the agreed-upon key being used directly as the Content Encryption Key (CEK) (rather than being used to wrap the CEK).
-
ECDH_ES_A128KW
public static final JWEAlgorithm ECDH_ES_A128KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A128KW" function (rather than being used directly as the CEK).
-
ECDH_ES_A192KW
public static final JWEAlgorithm ECDH_ES_A192KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A192KW" function (rather than being used directly as the CEK).
-
ECDH_ES_A256KW
public static final JWEAlgorithm ECDH_ES_A256KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A256KW" function (rather than being used directly as the CEK).
-
ECDH_1PU
public static final JWEAlgorithm ECDH_1PU
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement using the Concat KDF, as defined in section 5.8.1 of NIST.800-56A, with the agreed-upon key being used directly as the Content Encryption Key (CEK) (rather than being used to wrap the CEK).
-
ECDH_1PU_A128KW
public static final JWEAlgorithm ECDH_1PU_A128KW
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement per "ECDH-1PU", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A128KW" function (rather than being used directly as the CEK).
-
ECDH_1PU_A192KW
public static final JWEAlgorithm ECDH_1PU_A192KW
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement per "ECDH-1PU", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A192KW" function (rather than being used directly as the CEK).
-
ECDH_1PU_A256KW
public static final JWEAlgorithm ECDH_1PU_A256KW
Elliptic Curve Diffie-Hellman One-Pass Unified Model key agreement per "ECDH-1PU", but where the agreed-upon key is used to wrap the Content Encryption Key (CEK) with the "A256KW" function (rather than being used directly as the CEK).
-
A128GCMKW
public static final JWEAlgorithm A128GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 128 bit keys.
-
A192GCMKW
public static final JWEAlgorithm A192GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 192 bit keys.
-
A256GCMKW
public static final JWEAlgorithm A256GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 256 bit keys.
-
PBES2_HS256_A128KW
public static final JWEAlgorithm PBES2_HS256_A128KW
PBES2 (RFC 2898) with HMAC SHA-256 as the PRF and AES Key Wrap (RFC 3394) using 128 bit keys for the encryption scheme.
-
PBES2_HS384_A192KW
public static final JWEAlgorithm PBES2_HS384_A192KW
PBES2 (RFC 2898) with HMAC SHA-384 as the PRF and AES Key Wrap (RFC 3394) using 192 bit keys for the encryption scheme.
-
PBES2_HS512_A256KW
public static final JWEAlgorithm PBES2_HS512_A256KW
PBES2 (RFC 2898) with HMAC SHA-512 as the PRF and AES Key Wrap (RFC 3394) using 256 bit keys for the encryption scheme.
-
-
Constructor Detail
-
JWEAlgorithm
public JWEAlgorithm(String name, Requirement req)
Creates a new JSON Web Encryption (JWE) algorithm.- Parameters:
name
- The algorithm name. Must not benull
.req
- The implementation requirement,null
if not known.
-
JWEAlgorithm
public JWEAlgorithm(String name)
Creates a new JSON Web Encryption (JWE) algorithm.- Parameters:
name
- The algorithm name. Must not benull
.
-
-
Method Detail
-
parse
public static JWEAlgorithm parse(String s)
Parses a JWE algorithm from the specified string.- Parameters:
s
- The string to parse. Must not benull
.- Returns:
- The JWE algorithm (matching standard algorithm constant, else a newly created algorithm).
-
-