Package org.bouncycastle.crypto.general
Class GeneralSecureRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
org.bouncycastle.crypto.general.GeneralSecureRandom
- All Implemented Interfaces:
Serializable,RandomGenerator
Base class for DRBG/RNG SecureRandom implementations that use non-FIPS approved algorithms.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
RandomGenerator.ArbitrarilyJumpableGenerator, RandomGenerator.JumpableGenerator, RandomGenerator.LeapableGenerator, RandomGenerator.SplittableGenerator, RandomGenerator.StreamableGenerator -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generateSeed(int numBytes) Return the algorithm nameintReturn the block size of the underlying DRBGvoidnextBytes(byte[] bytes) voidnextBytes(byte[] bytes, byte[] additionalInput) voidreseed()Force a reseed.voidreseed(byte[] additionalInput) Force a reseed with additional input.voidsetSeed(byte[] seed) voidsetSeed(long seed) Methods inherited from class java.security.SecureRandom
getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, toStringMethods inherited from class java.util.Random
doubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLongMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.random.RandomGenerator
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
Return the algorithm name- Overrides:
getAlgorithmin classSecureRandom
-
nextBytes
public void nextBytes(byte[] bytes) - Specified by:
nextBytesin interfaceRandomGenerator- Overrides:
nextBytesin classSecureRandom
-
nextBytes
public void nextBytes(byte[] bytes, byte[] additionalInput) -
generateSeed
public byte[] generateSeed(int numBytes) - Overrides:
generateSeedin classSecureRandom
-
getBlockSize
public int getBlockSize()Return the block size of the underlying DRBG- Returns:
- number of bits produced each cycle.
-
reseed
public void reseed()Force a reseed.- Overrides:
reseedin classSecureRandom
-
reseed
public void reseed(byte[] additionalInput) Force a reseed with additional input.- Parameters:
additionalInput- additional input to be used in conjunction with reseed.
-