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

public Class FixedSecureRandom

extends SecureRandom
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, java.security.SecureRandom

A secure random that returns pre-seeded data to calls of nextBytes() or generateSeed().

Field Summary

Modifier and TypeField and Description
private byte[]
private int
private int

Constructor Summary

AccessConstructor and Description
public
FixedSecureRandom(byte[] value)

public
FixedSecureRandom(byte[][] values)

public
FixedSecureRandom(boolean intPad, byte[] value)

Pad the data on integer boundaries.

public
FixedSecureRandom(boolean intPad, byte[][] values)

Pad the data on integer boundaries.

Method Summary

Modifier and TypeMethod and Description
public byte[]
generateSeed(int
the number of seed bytes to generate.
numBytes
)

Overrides java.security.SecureRandom.generateSeed.

Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.
public boolean
public void
nextBytes(byte[]
the array to be filled in with random bytes.
bytes
)

Overrides java.security.SecureRandom.nextBytes.

Overrides default java.util.random.RandomGenerator.nextBytes.

Generates a user-specified number of random bytes.
public int
nextInt()

Overrides java.util.Random.nextInt.

Overrides default java.util.random.RandomGenerator.nextInt.

Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
public long
nextLong()

Overrides java.util.Random.nextLong.

Implements java.util.random.RandomGenerator.nextLong.

Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
private int
Inherited from java.security.SecureRandom:
getAlgorithmgetInstancegetInstancegetInstancegetInstancegetInstancegetInstancegetInstanceStronggetParametersgetProvidergetSeednextnextBytesreseedreseedsetSeedsetSeedtoString

Field Detail

_databack to summary
private byte[] _data
_indexback to summary
private int _index
_intPadback to summary
private int _intPad

Constructor Detail

FixedSecureRandomback to summary
public FixedSecureRandom(byte[] value)
FixedSecureRandomback to summary
public FixedSecureRandom(byte[][] values)
FixedSecureRandomback to summary
public FixedSecureRandom(boolean intPad, byte[] value)

Pad the data on integer boundaries. This is necessary for the classpath project's BigInteger implementation.

FixedSecureRandomback to summary
public FixedSecureRandom(boolean intPad, byte[][] values)

Pad the data on integer boundaries. This is necessary for the classpath project's BigInteger implementation.

Method Detail

generateSeedback to summary
public byte[] generateSeed(int numBytes)

Overrides java.security.SecureRandom.generateSeed.

Doc from java.security.SecureRandom.generateSeed.

Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself. This call may be used to seed other random number generators.

Parameters
numBytes:int

the number of seed bytes to generate.

Returns:byte[]

the seed bytes.

isExhaustedback to summary
public boolean isExhausted()
nextBytesback to summary
public void nextBytes(byte[] bytes)

Overrides java.security.SecureRandom.nextBytes.

Overrides default java.util.random.RandomGenerator.nextBytes.

Doc from java.security.SecureRandom.nextBytes.

Generates a user-specified number of random bytes.

Parameters
bytes:byte[]

the array to be filled in with random bytes.

nextIntback to summary
public int nextInt()

Overrides java.util.Random.nextInt.

Overrides default java.util.random.RandomGenerator.nextInt.

Doc from java.util.Random.nextInt.

Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence. The general contract of nextInt is that one int value is pseudorandomly generated and returned. All 232 possible int values are produced with (approximately) equal probability.

Returns:int

the next pseudorandom, uniformly distributed int value from this random number generator's sequence

nextLongback to summary
public long nextLong()

Overrides java.util.Random.nextLong.

Implements java.util.random.RandomGenerator.nextLong.

Doc from java.util.Random.nextLong.

Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence. The general contract of nextLong is that one long value is pseudorandomly generated and returned.

Returns:long

the next pseudorandom, uniformly distributed long value from this random number generator's sequence

nextValueback to summary
private int nextValue()