Top Description Fields Constructors Methods
org.bouncycastle.util.test

public Class TestRandomEntropySourceProvider

extends Object
implements EntropySourceProvider
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.prng.EntropySourceProvider
Imports
java.security.SecureRandom, org.bouncycastle.crypto.prng.EntropySource, .EntropySourceProvider

A class for returning "quick entropy" for testing purposes.

Field Summary

Modifier and TypeField and Description
private final boolean
private final SecureRandom

Constructor Summary

AccessConstructor and Description
public
TestRandomEntropySourceProvider(boolean
boolean indicating if the SecureRandom is based on prediction resistant entropy or not (true if it is).
isPredictionResistant
)

Create a test entropy source provider.

Method Summary

Modifier and TypeMethod and Description
public EntropySource

Returns:

an EntropySource that generates bitsRequired bits of entropy on each call to its getEntropy() method.
get
(final int
size (in bits) of entropy to be created by the provided source.
bitsRequired
)

Implements org.bouncycastle.crypto.prng.EntropySourceProvider.get.

Return an entropy source that will create bitsRequired bits of entropy on each invocation of getEntropy().

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_predictionResistantback to summary
private final boolean _predictionResistant
_srback to summary
private final SecureRandom _sr

Constructor Detail

TestRandomEntropySourceProviderback to summary
public TestRandomEntropySourceProvider(boolean isPredictionResistant)

Create a test entropy source provider.

Parameters
isPredictionResistant:boolean

boolean indicating if the SecureRandom is based on prediction resistant entropy or not (true if it is).

Method Detail

getback to summary
public EntropySource get(final int bitsRequired)

Implements org.bouncycastle.crypto.prng.EntropySourceProvider.get.

Return an entropy source that will create bitsRequired bits of entropy on each invocation of getEntropy().

Parameters
bitsRequired:int

size (in bits) of entropy to be created by the provided source.

Returns:EntropySource

an EntropySource that generates bitsRequired bits of entropy on each call to its getEntropy() method.