java.lang.Object
org.bouncycastle.crypto.params.ParametersWithRandom
All Implemented Interfaces:
CipherParameters

public class ParametersWithRandomextends Object implements CipherParameters
Cipher parameters with associated random number generator. Wraps cipher parameters with a secure random source for cryptographic operations.
  • Field Details

    • random

      private SecureRandom random
      The random the operation should use.
    • parameters

      private CipherParameters parameters
      The parameters being wrapped.
  • Constructor Details

    • ParametersWithRandom

      public ParametersWithRandom(CipherParameters parameters, SecureRandom random)
      Wrap parameters with random.
      Parameters:
      parameters - the cipher parameters to wrap; they are returned unchanged by getParameters()
      random - the secure random source for operations needing one, resolved through the CryptoServicesRegistrar; null selects the registrar's default instance
    • ParametersWithRandom

      public ParametersWithRandom(CipherParameters parameters)
      Wrap parameters with default random.
      Parameters:
      parameters - the cipher parameters to wrap; they are returned unchanged by getParameters()
  • Method Details

    • getRandom

      public SecureRandom getRandom()
      Supplies the secure random source for operations needing one.
      Returns:
      the secure random source carried by these parameters, never null
    • getParameters

      public CipherParameters getParameters()
      Unwraps the cipher parameters passed to the constructor.
      Returns:
      the wrapped cipher parameters, exactly the instance supplied to the constructor