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
,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 class
BigInteger Source - in this case we expect requests for data that will be used for BigIntegers.static class
Data Source - in this case we just expect requests for byte arrays.static class
Base class for sources of fixed "Randomness"Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
RandomGenerator.ArbitrarilyJumpableGenerator, RandomGenerator.JumpableGenerator, RandomGenerator.LeapableGenerator, RandomGenerator.SplittableGenerator, RandomGenerator.StreamableGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionFixedSecureRandom
(byte[] value) FixedSecureRandom
(byte[][] values) FixedSecureRandom
(FixedSecureRandom.Source[] sources) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
generateSeed
(int numBytes) boolean
void
nextBytes
(byte[] bytes) int
nextInt()
long
nextLong()
Methods inherited from class java.security.SecureRandom
getAlgorithm, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, reseed, setSeed, setSeed, toString
Methods inherited from class java.util.Random
doubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
nextBytes
in interfaceRandomGenerator
- Overrides:
nextBytes
in classSecureRandom
-
generateSeed
public byte[] generateSeed(int numBytes) - Overrides:
generateSeed
in classSecureRandom
-
nextInt
public int nextInt()- Specified by:
nextInt
in interfaceRandomGenerator
- Overrides:
nextInt
in classRandom
-
nextLong
public long nextLong()- Specified by:
nextLong
in interfaceRandomGenerator
- Overrides:
nextLong
in classRandom
-
isExhausted
public boolean isExhausted()
-