java.security

Class SecureRandomSpi

public abstract class SecureRandomSpi extends Object implements Serializable

SecureRandomSpi is the Service Provider Interface for SecureRandom providers. It provides an interface for providers to the SecureRandom engine to write their own pseudo-random number generator.

Since: JDK 1.2

Constructor Summary
SecureRandomSpi()
Default Constructor for SecureRandomSpi
Method Summary
protected abstract byte[]engineGenerateSeed(int numBytes)
Gets a user specified number of bytes specified by the parameter.
protected abstract voidengineNextBytes(byte[] bytes)
Gets a user specified number of bytes depending on the length of the array?
protected abstract voidengineSetSeed(byte[] seed)
Updates the seed for SecureRandomSpi but does not reset seed.

Constructor Detail

SecureRandomSpi

public SecureRandomSpi()
Default Constructor for SecureRandomSpi

Method Detail

engineGenerateSeed

protected abstract byte[] engineGenerateSeed(int numBytes)
Gets a user specified number of bytes specified by the parameter.

Parameters: numBytes number of random bytes to generate

Returns: an array full of random bytes

engineNextBytes

protected abstract void engineNextBytes(byte[] bytes)
Gets a user specified number of bytes depending on the length of the array?

Parameters: bytes array to fill with random bytes

engineSetSeed

protected abstract void engineSetSeed(byte[] seed)
Updates the seed for SecureRandomSpi but does not reset seed. It does to this so repeated called never decrease randomness.