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.void
setProvider
(Provider provider) Sets the JCA provider to be used for all operations.void
setSecureRandom
(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,null
to use the default.randomGen
- The specific secure random generator,null
to 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,
null
implies 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,null
to use the default.
-
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,null
to use the default system one.
-