Package org.bouncycastle.util.test
Class FixedEntropySourceProvider
- java.lang.Object
-
- org.bouncycastle.util.test.FixedEntropySourceProvider
-
- All Implemented Interfaces:
EntropySourceProvider
public class FixedEntropySourceProvider extends java.lang.Object implements EntropySourceProvider
An "entropy" provider which returns pre-defined data on request.
-
-
Constructor Summary
Constructors Constructor Description FixedEntropySourceProvider(byte[] data, boolean isPredictionResistant)
Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntropySource
get(int bitsRequired)
Return an EntropySource based on the data provided to this object.
-
-
-
Constructor Detail
-
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 Detail
-
get
public EntropySource get(int bitsRequired)
Return an EntropySource based on the data provided to this object.- Specified by:
get
in interfaceEntropySourceProvider
- Parameters:
bitsRequired
- the size of the block of entropy required.- Returns:
- a new EntropySource.
-
-