All Implemented Interfaces:
Serializable, RandomGenerator

  • Nested Class Summary

  • Constructor Summary

    Constructors

    Constructs a secure random number generator (RNG) implementing the default random number algorithm.

    SecureRandom(byte[] seed)

    Constructs a secure random number generator (RNG) implementing the default random number algorithm.

    protected

    Creates a SecureRandom object.

  • Method Summary

    byte[]

    generateSeed(int numBytes)

    Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.

    Returns the name of the algorithm implemented by this SecureRandom object.

    Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.

    Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.

    Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.

    Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm and supports the specified SecureRandomParameters request.

    Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm and supports the specified SecureRandomParameters request.

    Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm and supports the specified SecureRandomParameters request.

    Returns a SecureRandom object that was selected by using the algorithms/providers specified in the securerandom.strongAlgorithms Security property.

    Returns the provider of this SecureRandom object.

    static byte[]

    getSeed(int numBytes)

    Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.

    protected final int

    next(int numBits)

    Generates an integer containing the user-specified number of pseudo-random bits (right justified, with leading zeros).

    void

    nextBytes(byte[] bytes)

    Generates a user-specified number of random bytes.

    void

    Generates a user-specified number of random bytes with additional parameters.

    void

    reseed()

    Reseeds this SecureRandom with entropy input read from its entropy source.

    void

    Reseeds this SecureRandom with entropy input read from its entropy source with additional parameters.

    void

    setSeed(byte[] seed)

    Reseeds this random object with the given seed.

    void

    setSeed(long seed)

    Reseeds this random object, using the eight bytes contained in the given long seed.

    toString()

    Returns a Human-readable string representation of this SecureRandom.

  • Constructor Details

    • SecureRandom

    • SecureRandom

    • SecureRandom

  • Method Details

    • getInstance

    • getInstance

    • getInstance

    • getInstance

    • getInstance

    • getInstance

    • getProvider

    • getAlgorithm

    • toString

    • getParameters

    • setSeed

    • setSeed

    • nextBytes

    • nextBytes

    • next

    • getSeed

    • generateSeed

    • getInstanceStrong

    • reseed

    • reseed