Package com.nimbusds.jose.jca
Class JWEJCAContext
java.lang.Object
com.nimbusds.jose.jca.JCAContext
com.nimbusds.jose.jca.JWEJCAContext
Java Cryptography Architecture (JCA) context intended specifically for
JSON Web Encryption (JWE) providers. Allows setting of more specific JCA
providers for key encryption, content encryption and MAC computation.
- Version:
- 2015-06-08
- Author:
- Vladimir Dzhuvinov
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default JCA context for JWE.JWEJCAContext
(Provider generalProvider, Provider keProvider, Provider ceProvider, Provider macProvider, SecureRandom randomGen) Creates a new JCA context for JWE with the specified JCA providers and secure random generator. -
Method Summary
Modifier and TypeMethodDescriptionGets the specific JCA provider for the content encryption.Gets the specific JCA provider for the key encryption.Gets the specific JCA provider for the MAC computation (where required by the JWE encryption method).void
setContentEncryptionProvider
(Provider ceProvider) Sets a specific JCA provider for the content encryption.void
setKeyEncryptionProvider
(Provider keProvider) Sets a specific JCA provider for the key encryption.void
setMACProvider
(Provider macProvider) Sets a specific JCA provider for the MAC computation (where required by the JWE encryption method).Methods inherited from class com.nimbusds.jose.jca.JCAContext
getProvider, getSecureRandom, setProvider, setSecureRandom
-
Constructor Details
-
JWEJCAContext
public JWEJCAContext()Creates a new default JCA context for JWE. -
JWEJCAContext
public JWEJCAContext(Provider generalProvider, Provider keProvider, Provider ceProvider, Provider macProvider, SecureRandom randomGen) Creates a new JCA context for JWE with the specified JCA providers and secure random generator.- Parameters:
generalProvider
- The general JCA provider to be used for all operations where a more specific one is absent,null
to use the default system provider.keProvider
- The specific JCA provider to be used for the key encryption,null
to fall back to the general one, and if that is not specified to the default system provider.ceProvider
- The specific JCA provider to be used for the content encryption,null
to fall back to the general one, and if that is not specified to the default system provider.macProvider
- The specific JCA provider to be used for the MAC computation (where required by the JWE encryption method),null
to fall back to the general one, and if that is not specified to the default system provider.randomGen
- The specific secure random generator for the initialisation vector and other purposes requiring a random number,null
to use the default system one.
-
-
Method Details
-
setKeyEncryptionProvider
Sets a specific JCA provider for the key encryption.- Parameters:
keProvider
- The specific JCA provider to be used for the key encryption,null
to fall back to the general one, and if that is not specified to the default system provider.
-
getKeyEncryptionProvider
Gets the specific JCA provider for the key encryption.- Returns:
- The applicable JCA provider,
null
implies the default system provider.
-
setContentEncryptionProvider
Sets a specific JCA provider for the content encryption.- Parameters:
ceProvider
- The specific JCA provider to be used for the content encryption,null
to fall back to the general one, and if that is not specified to the default system provider.
-
getContentEncryptionProvider
Gets the specific JCA provider for the content encryption.- Returns:
- The applicable JCA provider,
null
implies the default system provider.
-
setMACProvider
Sets a specific JCA provider for the MAC computation (where required by the JWE encryption method).- Parameters:
macProvider
- The specific JCA provider to be used for the MAC computation (where required by the JWE encryption method),null
to fall back to the general one, and if that is not specified to the default system provider.
-
getMACProvider
Gets the specific JCA provider for the MAC computation (where required by the JWE encryption method).- Returns:
- The applicable JCA provider,
null
implies the default system provider.
-