Top Fields Constructors Methods
org.bouncycastle.crypto.prng

public Class X931SecureRandomBuilder

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.BlockCipher, .CryptoServicesRegistrar, org.bouncycastle.crypto.params.KeyParameter, org.bouncycastle.util.Arrays, .Pack

Field Summary

Modifier and TypeField and Description
private byte[]
private EntropySourceProvider
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
X931SecureRandomBuilder()

Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with predictionResistant set to false.

public
X931SecureRandomBuilder(SecureRandom entropySource, boolean predictionResistant)

Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value for prediction resistance.

public
X931SecureRandomBuilder(EntropySourceProvider
a provider of EntropySource objects.
entropySourceProvider
)

Create a builder which makes creates the SecureRandom objects from a specified entropy source provider.

Method Summary

Modifier and TypeMethod and Description
public X931SecureRandom

Returns:

a SecureRandom.
build
(BlockCipher
a block cipher to use as the operator.
engine
,
KeyParameter
the block cipher key to initialise engine with.
key
,
boolean
true if engine to be reseeded on each use, false otherwise.
predictionResistant
)

Construct a X9.31 secure random generator using the passed in engine and key.

public X931SecureRandomBuilder
setDateTimeVector(byte[] dateTimeVector)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dateTimeVectorback to summary
private byte[] dateTimeVector
entropySourceProviderback to summary
private EntropySourceProvider entropySourceProvider
randomback to summary
private SecureRandom random

Constructor Detail

X931SecureRandomBuilderback to summary
public X931SecureRandomBuilder()

Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with predictionResistant set to false.

Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if the default SecureRandom does for its generateSeed() call.

X931SecureRandomBuilderback to summary
public X931SecureRandomBuilder(SecureRandom entropySource, boolean predictionResistant)

Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value for prediction resistance.

Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if the passed in SecureRandom does for its generateSeed() call.

X931SecureRandomBuilderback to summary
public X931SecureRandomBuilder(EntropySourceProvider entropySourceProvider)

Create a builder which makes creates the SecureRandom objects from a specified entropy source provider.

Note

If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored.

Parameters
entropySourceProvider:EntropySourceProvider

a provider of EntropySource objects.

Method Detail

buildback to summary
public X931SecureRandom build(BlockCipher engine, KeyParameter key, boolean predictionResistant)

Construct a X9.31 secure random generator using the passed in engine and key. If predictionResistant is true the generator will be reseeded on each request.

Parameters
engine:BlockCipher

a block cipher to use as the operator.

key:KeyParameter

the block cipher key to initialise engine with.

predictionResistant:boolean

true if engine to be reseeded on each use, false otherwise.

Returns:X931SecureRandom

a SecureRandom.

setDateTimeVectorback to summary
public X931SecureRandomBuilder setDateTimeVector(byte[] dateTimeVector)