Package com.nimbusds.jose
Class JWEAlgorithm
java.lang.Object
com.nimbusds.jose.Algorithm
com.nimbusds.jose.JWEAlgorithm
- All Implemented Interfaces:
Serializable
JSON Web Encryption (JWE) algorithm name, represents the
alg
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:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JWEAlgorithm
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 128 bit keys.static final JWEAlgorithm
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 128 bit keys.static final JWEAlgorithm
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 192 bit keys.static final JWEAlgorithm
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 192 bit keys.static final JWEAlgorithm
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 256 bit keys.static final JWEAlgorithm
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys.static final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
Deprecated.static final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
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 final JWEAlgorithm
Deprecated. -
Constructor Summary
ConstructorDescriptionJWEAlgorithm
(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
Modifier and TypeMethodDescriptionstatic JWEAlgorithm
Parses a JWE algorithm from the specified string.Methods inherited from class com.nimbusds.jose.Algorithm
equals, getName, getRequirement, hashCode, toJSONString, toString
-
Field Details
-
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.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
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
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
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
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 128 bit keys. -
A192KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 192 bit keys. -
A256KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys. -
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
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
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
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
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
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
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
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
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
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 128 bit keys. -
A192GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 192 bit keys. -
A256GCMKW
AES in Galois/Counter Mode (GCM) (NIST.800-38D) 256 bit keys. -
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
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
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 Details
-
JWEAlgorithm
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
Creates a new JSON Web Encryption (JWE) algorithm.- Parameters:
name
- The algorithm name. Must not benull
.
-
-
Method Details
-
parse
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).
-