Package org.bouncycastle.crypto.prng
Class FixedSecureRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
org.bouncycastle.crypto.prng.FixedSecureRandom
- All Implemented Interfaces:
Serializable,RandomGenerator
A secure random that returns pre-seeded data to calls of nextBytes() or generateSeed().
- 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 -
Constructor Summary
ConstructorsConstructorDescriptionFixedSecureRandom(boolean intPad, byte[] value) Pad the data on integer boundaries.FixedSecureRandom(boolean intPad, byte[][] values) Pad the data on integer boundaries.FixedSecureRandom(byte[] value) FixedSecureRandom(byte[][] values) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generateSeed(int numBytes) booleanvoidnextBytes(byte[] bytes) intnextInt()longnextLong()Methods inherited from class java.security.SecureRandom
getAlgorithm, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, reseed, setSeed, setSeed, toStringMethods inherited from class java.util.Random
doubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextIntMethods 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
-
Constructor Details
-
FixedSecureRandom
public FixedSecureRandom(byte[] value) -
FixedSecureRandom
public FixedSecureRandom(byte[][] values) -
FixedSecureRandom
public FixedSecureRandom(boolean intPad, byte[] value) Pad the data on integer boundaries. This is necessary for the classpath project's BigInteger implementation. -
FixedSecureRandom
public FixedSecureRandom(boolean intPad, byte[][] values) Pad the data on integer boundaries. This is necessary for the classpath project's BigInteger implementation.
-
-
Method Details
-
nextBytes
public void nextBytes(byte[] bytes) - Specified by:
nextBytesin interfaceRandomGenerator- Overrides:
nextBytesin classSecureRandom
-
generateSeed
public byte[] generateSeed(int numBytes) - Overrides:
generateSeedin classSecureRandom
-
nextInt
public int nextInt()- Specified by:
nextIntin interfaceRandomGenerator- Overrides:
nextIntin classRandom
-
nextLong
public long nextLong()- Specified by:
nextLongin interfaceRandomGenerator- Overrides:
nextLongin classRandom
-
isExhausted
public boolean isExhausted()
-