org.bouncycastle.crypto.prng

## Class BasicEntropySourceProvider

- java.lang.Object
- - org.bouncycastle.crypto.prng.BasicEntropySourceProvider

- All Implemented Interfaces:
    EntropySourceProvider

      public class BasicEntropySourceProvider
      extends java.lang.Object
      implements EntropySourceProvider

  An EntropySourceProvider where entropy generation is based on a SecureRandom output using SecureRandom.generateSeed().

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicEntropySourceProvider(java.security.SecureRandom random, boolean isPredictionResistant)` Create a entropy source provider based on the passed in SecureRandom.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EntropySource` | `get(int bitsRequired)` Return an entropy source that will create bitsRequired bits of entropy on each invocation of getEntropy().

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BasicEntropySourceProvider

          public BasicEntropySourceProvider(java.security.SecureRandom random,
                                            boolean isPredictionResistant)

      Create a entropy source provider based on the passed in SecureRandom.
      Parameters:
        `random` - the SecureRandom to base EntropySource construction on.
        `isPredictionResistant` - boolean indicating if the SecureRandom is based on prediction resistant entropy or not (true if it is).

  - ### Method Detail

    - #### get

          public EntropySource get(int bitsRequired)

      Return an entropy source that will create bitsRequired bits of entropy on each invocation of getEntropy().
      Specified by:
        `get` in interface `EntropySourceProvider`
      Parameters:
        `bitsRequired` - size (in bits) of entropy to be created by the provided source.
      Returns:
        an EntropySource that generates bitsRequired bits of entropy on each call to its getEntropy() method.