oracle.spatial.security
Class SecureRandom

java.lang.Object
  extended by java.util.Random
      extended by oracle.spatial.security.SecureRandom
All Implemented Interfaces:
java.io.Serializable

public final class SecureRandom
extends java.util.Random

PRNG this class generates a random number An internal seed which gets generated at the first time and once every CYCLE calls is used to randomize the return random number _cache and _cursor work together. These two hold intermediate (pre-generated) bytes. The cache size is the same as the basic block generated size (20 bytes based on SHA). Cache comes into play mostly when a lot of little random number generator requests are made (int, long, double, etc.). Also, cache is expired when large byte requests are made (larger than the remaining cache data). Cache may also be expired at other times, if deemed appropriate.

See Also:
Serialized Form

Constructor Summary
SecureRandom()
           
 
Method Summary
static boolean forceJCA(boolean b)
          Forces system to use supplied JCA Random.
protected  int next(int bits)
           
 void nextBytes(byte[] bytes)
           
 void setSeed(byte[] seed)
           
 void setSeed(long seed)
           
static boolean setSunLoops(int times)
          Sets the number of times to run sun secure random This could be used in two ways: a.
 
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
 

Constructor Detail

SecureRandom

public SecureRandom()
Method Detail

setSunLoops

public static final boolean setSunLoops(int times)
Sets the number of times to run sun secure random This could be used in two ways: a. to not run it at all (set to ZERO). b. to run it enough times to acquire the proper entropy level.


forceJCA

public static final boolean forceJCA(boolean b)
Forces system to use supplied JCA Random. May not work if none provided. Returns boolean indicating success of the force operation. This class cannot be a JCA class, else INFINITE RECURSION!!!


next

protected final int next(int bits)
Overrides:
next in class java.util.Random

nextBytes

public final void nextBytes(byte[] bytes)
Overrides:
nextBytes in class java.util.Random

setSeed

public final void setSeed(long seed)
Overrides:
setSeed in class java.util.Random

setSeed

public final void setSeed(byte[] seed)