Known Direct Subclasses
SecureRandom |
This class provides a crytpographically strong pseudo-random number
generator based on the SHA-1 hash algorithm. |
|
Class Overview
This class defines the Service Provider Interface (SPI)
for the SecureRandom
class.
All the abstract methods in this class must be implemented by each
service provider who wishes to supply the implementation
of a cryptographically strong pseudo-random number generator.
Summary
Protected Methods |
abstract
byte[]
|
engineGenerateSeed(int numBytes)
Returns the given number of seed bytes.
|
abstract
void
|
engineNextBytes(byte[] bytes)
Generates a user-specified number of random bytes.
|
abstract
void
|
engineSetSeed(byte[] seed)
Reseeds this random object.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Public Constructors
public
SecureRandomSpi
()
Protected Methods
protected
abstract
byte[]
engineGenerateSeed
(int numBytes)
Returns the given number of seed bytes. This call may be used to
seed other random number generators.
Parameters
numBytes
| the number of seed bytes to generate. |
protected
abstract
void
engineNextBytes
(byte[] bytes)
Generates a user-specified number of random bytes.
If a call to engineSetSeed
had not occurred previously,
the first call to this method forces this SecureRandom implementation
to seed itself. This self-seeding will not occur if
engineSetSeed
was previously called.
Parameters
bytes
| the array to be filled in with random bytes.
|
protected
abstract
void
engineSetSeed
(byte[] seed)
Reseeds this random object. The given seed supplements, rather than
replaces, the existing seed. Thus, repeated calls are guaranteed
never to reduce randomness.