API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.security. SecureRandom View Source
Author(s)
Benjamin Renaud
Josh Bloch
Since
Version
1.54, 04/21/06
Serial
Hierarchy
 Object
      Random
          SecureRandom
Implements
Subclasses
Description
public class SecureRandom
  This class provides a cryptographically strong random number generator (RNG).
See also:    SecureRandomSpi Random
Constructors
public SecureRandom ()
  Constructs a secure random number generator (RNG) implementing the default random number algorithm.
public SecureRandom (byte[] seed)
  Constructs a secure random number generator (RNG) implementing the default random number algorithm.
protected SecureRandom (SecureRandomSpi secureRandomSpi, Provider provider)
  Creates a SecureRandom object.
private SecureRandom (SecureRandomSpi secureRandomSpi, Provider provider, String algorithm)
Methods
Hide/Show inherited methods
public byte generateSeed (int numBytes)
  Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.
public String getAlgorithm ()
  Returns the name of the algorithm implemented by this SecureRandom object.
publicstatic SecureRandom getInstance (String algorithm) throws NoSuchAlgorithmException
  Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.
publicstatic SecureRandom getInstance (String algorithm, Provider provider) throws NoSuchAlgorithmException
  Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.
publicstatic SecureRandom getInstance (String algorithm, String provider) throws NoSuchAlgorithmException NoSuchProviderException
  Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.
publicfinal Provider getProvider ()
  Returns the provider of this SecureRandom object.
pack-private SecureRandomSpi getSecureRandomSpi ()
Returns the SecureRandomSpi of this SecureRandom object.
publicstatic byte getSeed (int numBytes)
  Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.
protectedfinal int next (int numBits) [Overrides Random]
  Generates an integer containing the user-specified number of pseudo-random bits (right justified, with leading zeros).
public boolean nextBoolean () [Inherited From Random]
  Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.
publicsynchronized void nextBytes (byte[] bytes) [Overrides Random]
  Generates a user-specified number of random bytes.
public double nextDouble () [Inherited From Random]
  Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.
public float nextFloat () [Inherited From Random]
  Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.
publicsynchronized double nextGaussian () [Inherited From Random]
  Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.
public int nextInt () [Inherited From Random]
  Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
public int nextInt (int n) [Inherited From Random]
  Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
public long nextLong () [Inherited From Random]
  Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
publicsynchronized void setSeed (byte[] seed)
  Reseeds this random object.
public void setSeed (long seed) [Overrides Random]
  Reseeds this random object, using the eight bytes contained in the given long seed.
Fields
Hide/Show inherited fields
pack-privatefinalstatic long serialVersionUID = "4940670005562187"
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar