Package com.nimbusds.jose.jca
Class JCAContext
java.lang.Object
com.nimbusds.jose.jca.JCAContext
- Direct Known Subclasses:
JWEJCAContext
Java Cryptography Architecture (JCA) context, consisting of a JCA
provider and
secure random generator.- Version:
- 2015-06-08
- Author:
- Vladimir Dzhuvinov
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default JCA context.JCAContext(Provider provider, SecureRandom randomGen) Creates a new JCA context. -
Method Summary
Modifier and TypeMethodDescriptionGets the JCA provider to be used for all operations.Gets the secure random generator.voidsetProvider(Provider provider) Sets the JCA provider to be used for all operations.voidsetSecureRandom(SecureRandom randomGen) Sets a specific secure random generator for the initialisation vector and other purposes requiring a random number.
-
Constructor Details
-
JCAContext
public JCAContext()Creates a new default JCA context. -
JCAContext
Creates a new JCA context.- Parameters:
provider- The JCA provider,nullto use the default system one.randomGen- The specific secure random generator,nullto use the default system one.
-
-
Method Details
-
getProvider
Gets the JCA provider to be used for all operations.- Returns:
- The JCA provider to be used for all operations where a more
specific one is absent,
nullimplies the default system provider.
-
setProvider
Sets the JCA provider to be used for all operations.- Parameters:
provider- The JCA provider to be used for all operations where a more specific one is absent,nullto use the default system provider.
-
getSecureRandom
Gets the secure random generator. Intended for generation of initialisation vectors and other purposes that require a secure random generator.- Returns:
- The specific secure random generator (if available), else the default system one.
-
setSecureRandom
Sets a specific secure random generator for the initialisation vector and other purposes requiring a random number.- Parameters:
randomGen- The secure random generator,nullto use the default system one.
-