Package org.bouncycastle.util.test
Class FixedSecureRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
org.bouncycastle.util.test.FixedSecureRandom
- All Implemented Interfaces:
Serializable,java.util.random.RandomGenerator
- Direct Known Subclasses:
TestRandomBigInteger,TestRandomData
A secure random that returns pre-seeded data to calls of nextBytes() or generateSeed().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBigInteger Source - in this case we expect requests for data that will be used for BigIntegers.static classData Source - in this case we just expect requests for byte arrays.static classBase class for sources of fixed "Randomness"Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
java.util.random.RandomGenerator.ArbitrarilyJumpableGenerator, java.util.random.RandomGenerator.JumpableGenerator, java.util.random.RandomGenerator.LeapableGenerator, java.util.random.RandomGenerator.SplittableGenerator, java.util.random.RandomGenerator.StreamableGenerator -
Constructor Summary
ConstructorsConstructorDescriptionFixedSecureRandom(byte[] value) FixedSecureRandom(byte[][] values) FixedSecureRandom(FixedSecureRandom.Source[] sources) -
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
-
-
Method Details
-
nextBytes
public void nextBytes(byte[] bytes) - Specified by:
nextBytesin interfacejava.util.random.RandomGenerator- Overrides:
nextBytesin classSecureRandom
-
generateSeed
public byte[] generateSeed(int numBytes) - Overrides:
generateSeedin classSecureRandom
-
nextInt
public int nextInt() -
nextLong
public long nextLong() -
isExhausted
public boolean isExhausted()
-