Class SP800SecureRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
org.bouncycastle.crypto.prng.SP800SecureRandom
- All Implemented Interfaces:
Serializable, RandomGenerator
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface RandomGenerator
RandomGenerator.ArbitrarilyJumpableGenerator, RandomGenerator.JumpableGenerator, RandomGenerator.LeapableGenerator, RandomGenerator.SplittableGenerator, RandomGenerator.StreamableGenerator -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generateSeed(int numBytes) voidnextBytes(byte[] bytes) voidnextBytes(byte[] bytes, byte[] additionalInput) Generate a user-specified number of random bytes, passing additional input to the DRBG.voidreseed(byte[] additionalInput) Force a reseed of the DRBGvoidsetSeed(byte[] seed) voidsetSeed(long seed) Methods inherited from class SecureRandom
getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, reseed, toStringMethods inherited from class Random
doubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLongMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface RandomGenerator
equiDoubles, isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Method Details
-
setSeed
public void setSeed(byte[] seed) - Overrides:
setSeedin classSecureRandom
-
setSeed
public void setSeed(long seed) - Overrides:
setSeedin classSecureRandom
-
getAlgorithm
- Overrides:
getAlgorithmin classSecureRandom
-
nextBytes
public void nextBytes(byte[] bytes) - Specified by:
nextBytesin interfaceRandomGenerator- Overrides:
nextBytesin classSecureRandom
-
nextBytes
public void nextBytes(byte[] bytes, byte[] additionalInput) Generate a user-specified number of random bytes, passing additional input to the DRBG.- Parameters:
bytes- the array to be filled in with random bytes.additionalInput- optional additional input for the DRBG, may be null (cast a literal null to byte[], as Java 9 and later also have SecureRandom.nextBytes(byte[], SecureRandomParameters)).
-
generateSeed
public byte[] generateSeed(int numBytes) - Overrides:
generateSeedin classSecureRandom
-
reseed
public void reseed(byte[] additionalInput) Force a reseed of the DRBG- Parameters:
additionalInput- optional additional input
-