Class FixedEntropySourceProvider

java.lang.Object
org.bouncycastle.util.test.FixedEntropySourceProvider
All Implemented Interfaces:
EntropySourceProvider

public class FixedEntropySourceProvider extends Object implements EntropySourceProvider
An "entropy" provider which returns pre-defined data on request.
  • Constructor Details

    • FixedEntropySourceProvider

      public FixedEntropySourceProvider(byte[] data, boolean isPredictionResistant)
      Base constructor.
      Parameters:
      data - the data that will be returned by EntropySources created by this provider.
      isPredictionResistant - true if the EntropySource should be marked as prediction resistant, false otherwise.
  • Method Details

    • get

      public EntropySource get(int bitsRequired)
      Return an EntropySource based on the data provided to this object.
      Specified by:
      get in interface EntropySourceProvider
      Parameters:
      bitsRequired - the size of the block of entropy required.
      Returns:
      a new EntropySource.