Bouncy Castle Cryptography Library 1.87

org.bouncycastle.crypto.prng
Class SP800SecureRandom

java.lang.Object
  extended byjava.util.Random
      extended byjava.security.SecureRandom
          extended byorg.bouncycastle.crypto.prng.SP800SecureRandom
All Implemented Interfaces:
java.io.Serializable

public class SP800SecureRandom
extends java.security.SecureRandom

See Also:
Serialized Form

Method Summary
 byte[] generateSeed(int numBytes)
           
 java.lang.String getAlgorithm()
           
 void nextBytes(byte[] bytes)
           
 void nextBytes(byte[] bytes, byte[] additionalInput)
          Generate a user-specified number of random bytes, passing additional input to the DRBG.
 void reseed(byte[] additionalInput)
          Force a reseed of the DRBG
 void setSeed(byte[] seed)
           
 void setSeed(long seed)
           
 
Methods inherited from class java.security.SecureRandom
getInstance, getInstance, getInstance, getProvider, getSeed, next
 
Methods inherited from class java.util.Random
nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setSeed

public void setSeed(byte[] seed)

setSeed

public void setSeed(long seed)

getAlgorithm

public java.lang.String getAlgorithm()

nextBytes

public void nextBytes(byte[] bytes)

nextBytes

public void nextBytes(byte[] bytes,
                      byte[] additionalInput)
Generate a user-specified number of random bytes, passing additional input to the DRBG.

Parameters:
bytes - the array to be filled in with random bytes.
additionalInput - optional additional input for the DRBG, may be null (cast a literal null to byte[], as Java 9 and later also have SecureRandom.nextBytes(byte[], SecureRandomParameters)).

generateSeed

public byte[] generateSeed(int numBytes)

reseed

public void reseed(byte[] additionalInput)
Force a reseed of the DRBG

Parameters:
additionalInput - optional additional input

Bouncy Castle Cryptography Library 1.87