Class FipsSecureRandom

java.lang.Object
java.util.Random
java.security.SecureRandom
org.bouncycastle.crypto.fips.FipsSecureRandom
All Implemented Interfaces:
Serializable, RandomGenerator

public final class FipsSecureRandom extends SecureRandom
Base class for DRBG/RNG SecureRandom implementations that use FIPS approved algorithms.
See Also:
  • Method Details

    • setSeed

      public void setSeed(long seed)
      Overrides:
      setSeed in class SecureRandom
    • nextBytes

      public void nextBytes(byte[] bytes, byte[] additionalInput)
    • getAlgorithm

      public String getAlgorithm()
      Return the algorithm name
      Overrides:
      getAlgorithm in class SecureRandom
    • 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 class SecureRandom
    • reseed

      public void reseed(byte[] additionalInput)
      Force a reseed with additional input.
      Parameters:
      additionalInput - additional input to be used in conjunction with reseed.