Class X931PRNG.Base

java.lang.Object
org.bouncycastle.crypto.general.X931PRNG.Base
All Implemented Interfaces:
Parameters
Enclosing class:
X931PRNG

public static class X931PRNG.Base extends Object implements Parameters
Base for Builder for SecureRandom objects based on the X9.31 PRNG.
  • Method Details

    • fromDefaultEntropy

      public X931PRNG.Builder fromDefaultEntropy()
      Return a builder using an EntropySourceProvider based on the default SecureRandom with predictionResistant set to false.

      Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if the default SecureRandom does for its generateSeed() call.

      Returns:
      a new Builder instance.
    • fromEntropySource

      public X931PRNG.Builder fromEntropySource(SecureRandom entropySource, boolean predictionResistant)
      Return a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value for prediction resistance.

      Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if the passed in SecureRandom does for its generateSeed() call.

      Parameters:
      entropySource - a SecureRandom to use as a source of entropy for the PRNG.
      predictionResistant - true if the SecureRandom should be regarded as prediction resistant, false otherwise.
      Returns:
      a new builder instance.
    • fromEntropySource

      public X931PRNG.Builder fromEntropySource(EntropySourceProvider entropySourceProvider)
      Return a builder which makes creates the SecureRandom objects from a specified entropy source provider.

      Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored.

      Parameters:
      entropySourceProvider - a provider of EntropySource objects.
      Returns:
      a new builder instance.
    • getAlgorithm

      public Algorithm getAlgorithm()
      Description copied from interface: Parameters
      Return the algorithm these parameters are associated with.
      Specified by:
      getAlgorithm in interface Parameters
      Returns:
      the algorithm these parameters are for.