Top Description Fields Constructors Methods
org.bouncycastle.crypto.prng

public Class BasicEntropySourceProvider

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

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

Field Summary

Modifier and TypeField and Description
private final boolean
private final SecureRandom

Constructor Summary

AccessConstructor and Description
public
BasicEntropySourceProvider(SecureRandom
the SecureRandom to base EntropySource construction on.
random
,
boolean
boolean indicating if the SecureRandom is based on prediction resistant entropy or not (true if it is).
isPredictionResistant
)

Create a entropy source provider based on the passed in SecureRandom.

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

BasicEntropySourceProviderback to summary
public BasicEntropySourceProvider(SecureRandom random, boolean isPredictionResistant)

Create a entropy source provider based on the passed in SecureRandom.

Parameters
random:SecureRandom

the SecureRandom to base EntropySource construction on.

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.