Class DefaultJWEDecrypterFactory
java.lang.Object
com.nimbusds.jose.crypto.factories.DefaultJWEDecrypterFactory
- All Implemented Interfaces:
JCAAware<JWEJCAContext>
,JOSEProvider
,JWEProvider
,JWEDecrypterFactory
Default JSON Web Encryption (JWE) decrypter factory.
Supports all standard JWE algorithms implemented in the
com.nimbusds.jose.crypto
package.
- Version:
- 2020-03-03
- Author:
- Vladimir Dzhuvinov, stisve
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<JWEAlgorithm>
The supported JWE algorithms.static final Set<EncryptionMethod>
The supported encryption methods. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateJWEDecrypter
(JWEHeader header, Key key) Creates a new JWE decrypter for the specified header and key.Returns the Java Cryptography Architecture (JCA) context.Returns the names of the supported encryption methods by the JWE provier.Returns the names of the supported algorithms by the JWE provider instance.
-
Field Details
-
SUPPORTED_ALGORITHMS
The supported JWE algorithms. -
SUPPORTED_ENCRYPTION_METHODS
The supported encryption methods.
-
-
Constructor Details
-
DefaultJWEDecrypterFactory
public DefaultJWEDecrypterFactory()
-
-
Method Details
-
supportedJWEAlgorithms
Description copied from interface:JWEProvider
Returns the names of the supported algorithms by the JWE provider instance. These correspond to thealg
JWE header parameter.- Specified by:
supportedJWEAlgorithms
in interfaceJWEProvider
- Returns:
- The supported JWE algorithms, empty set if none.
-
supportedEncryptionMethods
Description copied from interface:JWEProvider
Returns the names of the supported encryption methods by the JWE provier. These correspond to theenc
JWE header parameter.- Specified by:
supportedEncryptionMethods
in interfaceJWEProvider
- Returns:
- The supported encryption methods, empty set if none.
-
getJCAContext
Description copied from interface:JCAAware
Returns the Java Cryptography Architecture (JCA) context. May be used to set a specific JCA security provider or secure random generator.- Specified by:
getJCAContext
in interfaceJCAAware<JWEJCAContext>
- Returns:
- The JCA context. Not
null
.
-
createJWEDecrypter
Description copied from interface:JWEDecrypterFactory
Creates a new JWE decrypter for the specified header and key.- Specified by:
createJWEDecrypter
in interfaceJWEDecrypterFactory
- Parameters:
header
- The JWE header. Notnull
.key
- The key intended to verify the JWS message. Notnull
.- Returns:
- The JWE decrypter.
- Throws:
JOSEException
- If the JWE algorithm / encryption method is not supported or the key type or length doesn't match expected for the JWE algorithm.
-