Top Fields Constructors Methods
org.bouncycastle.crypto.prng

public Class SP800SecureRandom

extends SecureRandom
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.prng.drbg.SP80090DRBG

Field Summary

Modifier and TypeField and Description
private SP80090DRBG
private final DRBGProvider
private final EntropySource
private final boolean
private final SecureRandom

Constructor Summary

AccessConstructor and Description
pack-priv
SP800SecureRandom(SecureRandom randomSource, EntropySource entropySource, DRBGProvider drbgProvider, boolean predictionResistant)

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 String
getAlgorithm()

Overrides java.security.SecureRandom.getAlgorithm.

Returns the name of the algorithm implemented by this SecureRandom object.

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 void
reseed(byte[]
optional additional input
additionalInput
)

Force a reseed of the DRBG

public void
setSeed(byte[]
the seed.
seed
)

Overrides java.security.SecureRandom.setSeed.

Reseeds this random object with the given seed.

public void
setSeed(long
the seed.
seed
)

Overrides java.security.SecureRandom.setSeed.

Reseeds this random object, using the eight bytes contained in the given long seed.

Inherited from java.security.SecureRandom:
getInstancegetInstancegetInstancegetInstancegetInstancegetInstancegetInstanceStronggetParametersgetProvidergetSeednextnextBytesreseedreseedtoString

Field Detail

drbgback to summary
private SP80090DRBG drbg
drbgProviderback to summary
private final DRBGProvider drbgProvider
entropySourceback to summary
private final EntropySource entropySource
predictionResistantback to summary
private final boolean predictionResistant
randomSourceback to summary
private final SecureRandom randomSource

Constructor Detail

SP800SecureRandomback to summary
pack-priv SP800SecureRandom(SecureRandom randomSource, EntropySource entropySource, DRBGProvider drbgProvider, boolean predictionResistant)

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.

getAlgorithmback to summary
public String getAlgorithm()

Overrides java.security.SecureRandom.getAlgorithm.

Doc from java.security.SecureRandom.getAlgorithm.

Returns the name of the algorithm implemented by this SecureRandom object.

Returns:String

the name of the algorithm or unknown if the algorithm name cannot be determined.

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.

reseedback to summary
public void reseed(byte[] additionalInput)

Force a reseed of the DRBG

Parameters
additionalInput:byte[]

optional additional input

setSeedback to summary
public void setSeed(byte[] seed)

Overrides java.security.SecureRandom.setSeed.

Doc from java.security.SecureRandom.setSeed.

Reseeds this random object with the given seed. The seed supplements, rather than replaces, the existing seed. Thus, repeated calls are guaranteed never to reduce randomness.

A PRNG SecureRandom will not seed itself automatically if setSeed is called before any nextBytes or reseed calls. The caller should make sure that the seed argument contains enough entropy for the security of this SecureRandom.

Parameters
seed:byte[]

the seed.

setSeedback to summary
public void setSeed(long seed)

Overrides java.security.SecureRandom.setSeed.

Doc from java.security.SecureRandom.setSeed.

Reseeds this random object, using the eight bytes contained in the given long seed. The given seed supplements, rather than replaces, the existing seed. Thus, repeated calls are guaranteed never to reduce randomness.

A PRNG SecureRandom will not seed itself automatically if setSeed is called before any nextBytes or reseed calls. The caller should make sure that the seed argument contains enough entropy for the security of this SecureRandom.

This method is defined for compatibility with java.util.Random.

Parameters
seed:long

the seed.