Class GeneralSecureRandom

  • All Implemented Interfaces:
    java.io.Serializable

    public final class GeneralSecureRandom
    extends java.security.SecureRandom
    Base class for DRBG/RNG SecureRandom implementations that use non-FIPS approved algorithms.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] generateSeed​(int numBytes)  
      int getBlockSize()
      Return the block size of the underlying DRBG
      void nextBytes​(byte[] bytes)  
      void nextBytes​(byte[] bytes, byte[] additionalInput)  
      void reseed()
      Force a reseed.
      void reseed​(byte[] additionalInput)
      Force a reseed with additional input.
      void setSeed​(byte[] seed)  
      void setSeed​(long seed)  
      • Methods inherited from class java.security.SecureRandom

        getAlgorithm, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, 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
    • Method Detail

      • setSeed

        public void setSeed​(byte[] seed)
        Overrides:
        setSeed in class java.security.SecureRandom
      • setSeed

        public void setSeed​(long seed)
        Overrides:
        setSeed in class java.security.SecureRandom
      • nextBytes

        public void nextBytes​(byte[] bytes)
        Overrides:
        nextBytes in class java.security.SecureRandom
      • nextBytes

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

        public byte[] generateSeed​(int numBytes)
        Overrides:
        generateSeed in class java.security.SecureRandom
      • getBlockSize

        public int getBlockSize()
        Return the block size of the underlying DRBG
        Returns:
        number of bits produced each cycle.
      • reseed

        public void reseed()
        Force a reseed.
        Overrides:
        reseed in class java.security.SecureRandom
      • reseed

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