Class DefaultJWEDecrypterFactory
- java.lang.Object
-
- com.nimbusds.jose.crypto.factories.DefaultJWEDecrypterFactory
-
- All Implemented Interfaces:
JCAAware<JWEJCAContext>,JOSEProvider,JWEProvider,JWEDecrypterFactory
@ThreadSafe public class DefaultJWEDecrypterFactory extends Object implements JWEDecrypterFactory
Default JSON Web Encryption (JWE) decrypter factory.Supports all standard JWE algorithms implemented in the
com.nimbusds.jose.cryptopackage.- Version:
- 2020-03-03
- Author:
- Vladimir Dzhuvinov, stisve
-
-
Field Summary
Fields Modifier and Type Field Description static Set<JWEAlgorithm>SUPPORTED_ALGORITHMSThe supported JWE algorithms.static Set<EncryptionMethod>SUPPORTED_ENCRYPTION_METHODSThe supported encryption methods.
-
Constructor Summary
Constructors Constructor Description DefaultJWEDecrypterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JWEDecryptercreateJWEDecrypter(JWEHeader header, Key key)Creates a new JWE decrypter for the specified header and key.JWEJCAContextgetJCAContext()Returns the Java Cryptography Architecture (JCA) context.Set<EncryptionMethod>supportedEncryptionMethods()Returns the names of the supported encryption methods by the JWE provier.Set<JWEAlgorithm>supportedJWEAlgorithms()Returns the names of the supported algorithms by the JWE provider instance.
-
-
-
Field Detail
-
SUPPORTED_ALGORITHMS
public static final Set<JWEAlgorithm> SUPPORTED_ALGORITHMS
The supported JWE algorithms.
-
SUPPORTED_ENCRYPTION_METHODS
public static final Set<EncryptionMethod> SUPPORTED_ENCRYPTION_METHODS
The supported encryption methods.
-
-
Constructor Detail
-
DefaultJWEDecrypterFactory
public DefaultJWEDecrypterFactory()
-
-
Method Detail
-
supportedJWEAlgorithms
public Set<JWEAlgorithm> supportedJWEAlgorithms()
Description copied from interface:JWEProviderReturns the names of the supported algorithms by the JWE provider instance. These correspond to thealgJWE header parameter.- Specified by:
supportedJWEAlgorithmsin interfaceJWEProvider- Returns:
- The supported JWE algorithms, empty set if none.
-
supportedEncryptionMethods
public Set<EncryptionMethod> supportedEncryptionMethods()
Description copied from interface:JWEProviderReturns the names of the supported encryption methods by the JWE provier. These correspond to theencJWE header parameter.- Specified by:
supportedEncryptionMethodsin interfaceJWEProvider- Returns:
- The supported encryption methods, empty set if none.
-
getJCAContext
public JWEJCAContext getJCAContext()
Description copied from interface:JCAAwareReturns the Java Cryptography Architecture (JCA) context. May be used to set a specific JCA security provider or secure random generator.- Specified by:
getJCAContextin interfaceJCAAware<JWEJCAContext>- Returns:
- The JCA context. Not
null.
-
createJWEDecrypter
public JWEDecrypter createJWEDecrypter(JWEHeader header, Key key) throws JOSEException
Description copied from interface:JWEDecrypterFactoryCreates a new JWE decrypter for the specified header and key.- Specified by:
createJWEDecrypterin 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.
-
-