Package java.security

Class SecureRandomSpi

java.lang.Object
java.security.SecureRandomSpi
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
OpenSSLRandom, SHA1PRNG_SecureRandomImpl

public abstract class SecureRandomSpi
extends Object
implements Serializable
SecureRandomSpi is the Service Provider Interface (SPI) definition for SecureRandom.
See Also:
SecureRandom, Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    SecureRandomSpi()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract byte[] engineGenerateSeed​(int numBytes)
    Generates and returns the specified number of seed bytes, computed using the seed generation algorithm used by this SecureRandomSpi.
    protected abstract void engineNextBytes​(byte[] bytes)
    Generates and stores random bytes in the given byte[] for each array element.
    protected abstract void engineSetSeed​(byte[] seed)
    Reseeds this SecureRandomSpi instance with the specified seed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SecureRandomSpi

      public SecureRandomSpi()
  • Method Details

    • engineSetSeed

      protected abstract void engineSetSeed​(byte[] seed)
      Reseeds this SecureRandomSpi instance with the specified seed. The seed of this SecureRandomSpi instance is supplemented, not replaced.
      Parameters:
      seed - the new seed.
    • engineNextBytes

      protected abstract void engineNextBytes​(byte[] bytes)
      Generates and stores random bytes in the given byte[] for each array element.
      Parameters:
      bytes - the byte[] to be filled with random bytes.
    • engineGenerateSeed

      protected abstract byte[] engineGenerateSeed​(int numBytes)
      Generates and returns the specified number of seed bytes, computed using the seed generation algorithm used by this SecureRandomSpi.
      Parameters:
      numBytes - the number of seed bytes.
      Returns:
      the seed bytes