Package org.bouncycastle.crypto.fips
Class FipsSecureRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
org.bouncycastle.crypto.fips.FipsSecureRandom
- All Implemented Interfaces:
Serializable
,RandomGenerator
Base class for DRBG/RNG SecureRandom implementations that use 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 TypeMethodDescriptionReturn the algorithm nameint
Return the block size of the underlying DRBGbyte[]
Return the personalization string used to create the DRBG.int
Return the security strength of the DRBG.boolean
Return true if the underlying DRBG is configured for prediction resistance.void
nextBytes
(byte[] bytes, byte[] additionalInput) void
reseed()
Force a reseed.void
reseed
(byte[] additionalInput) Force a reseed with additional input.void
setSeed
(long seed) Methods inherited from class java.security.SecureRandom
generateSeed, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, nextBytes, reseed, setSeed, toString
Methods inherited from class java.util.Random
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
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
-
Method Details
-
setSeed
public void setSeed(long seed) - Overrides:
setSeed
in classSecureRandom
-
nextBytes
public void nextBytes(byte[] bytes, byte[] additionalInput) -
getAlgorithm
Return the algorithm name- Overrides:
getAlgorithm
in classSecureRandom
-
getBlockSize
public int getBlockSize()Return the block size of the underlying DRBG- Returns:
- number of bits produced each cycle.
-
isPredictionResistant
public boolean isPredictionResistant()Return true if the underlying DRBG is configured for prediction resistance.- Returns:
- true if prediction resistance configured, false otherwise.
-
getPersonalizationString
public byte[] getPersonalizationString()Return the personalization string used to create the DRBG.- Returns:
- the the personalization string used to create the DRBG.
-
getSecurityStrength
public int getSecurityStrength()Return the security strength of the DRBG.- Returns:
- the security strength (in bits) of the DRBG.
-
reseed
public void reseed()Force a reseed.- Overrides:
reseed
in classSecureRandom
-
reseed
public void reseed(byte[] additionalInput) Force a reseed with additional input.- Parameters:
additionalInput
- additional input to be used in conjunction with reseed.
-