java.security
Class SecureRandomSpi

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.SecureRandomSpi
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public abstract class SecureRandomSpi
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

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.

Since:
1.2
See Also:
SecureRandom sample code for java.security.SecureRandom definition code for java.security.SecureRandom , Serialized Form

Constructor Summary
SecureRandomSpi sample code for java.security.SecureRandomSpi.SecureRandomSpi() definition code for java.security.SecureRandomSpi.SecureRandomSpi() ()
           
 
Method Summary
protected abstract  byte[] engineGenerateSeed sample code for java.security.SecureRandomSpi.engineGenerateSeed(int) definition code for java.security.SecureRandomSpi.engineGenerateSeed(int) (int numBytes)
          Returns the given number of seed bytes.
protected abstract  void engineNextBytes sample code for java.security.SecureRandomSpi.engineNextBytes(byte[]) definition code for java.security.SecureRandomSpi.engineNextBytes(byte[]) (byte[] bytes)
          Generates a user-specified number of random bytes.
protected abstract  void engineSetSeed sample code for java.security.SecureRandomSpi.engineSetSeed(byte[]) definition code for java.security.SecureRandomSpi.engineSetSeed(byte[]) (byte[] seed)
          Reseeds this random object.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

SecureRandomSpi sample code for java.security.SecureRandomSpi() definition code for java.security.SecureRandomSpi()

public SecureRandomSpi()
Method Detail

engineSetSeed sample code for java.security.SecureRandomSpi.engineSetSeed(byte[]) definition code for java.security.SecureRandomSpi.engineSetSeed(byte[])

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.

Parameters:
seed - the seed.

engineNextBytes sample code for java.security.SecureRandomSpi.engineNextBytes(byte[]) definition code for java.security.SecureRandomSpi.engineNextBytes(byte[])

protected abstract void engineNextBytes(byte[] bytes)
Generates a user-specified number of random bytes.

Parameters:
bytes - the array to be filled in with random bytes.

engineGenerateSeed sample code for java.security.SecureRandomSpi.engineGenerateSeed(int) definition code for java.security.SecureRandomSpi.engineGenerateSeed(int)

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.
Returns:
the seed bytes.