Class JCAContext

java.lang.Object
com.nimbusds.jose.jca.JCAContext
Direct Known Subclasses:
JWEJCAContext

public class JCAContext extends Object
Java Cryptography Architecture (JCA) context, consisting of a JCA provider and secure random generator.
Version:
2015-06-08
Author:
Vladimir Dzhuvinov
  • Constructor Details

    • JCAContext

      public JCAContext()
      Creates a new default JCA context.
    • JCAContext

      public JCAContext(Provider provider, SecureRandom randomGen)
      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

      public void setProvider(Provider provider)
      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

      public void setSecureRandom(SecureRandom randomGen)
      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.