All Downloads are FREE. Search and download functionalities are using the official Maven repository.

prng.SecureRandomImpl Maven / Gradle / Ivy

There is a newer version: 0.7
Show newest version
package prng;

import java.security.SecureRandom;
import prng.generator.BaseRandom;

/**
 * Implementation of a SecureRandom using a given SPI.
 *
 * @author Simon Greatrix
 */
class SecureRandomImpl extends SecureRandom {

  /** serial version UID */
  private static final long serialVersionUID = 2L;

  /** The actual PRNG */
  private final BaseRandom base;


  /**
   * Create secure random instance
   *
   * @param spi SPI to use
   */
  SecureRandomImpl(BaseRandom spi) {
    super(spi, SecureRandomProvider.PROVIDER);
    base = spi;
  }


  /**
   * Get some material that can be used to re-seed this PRNG.
   *
   * @return some seed material
   */
  public byte[] newSeed() {
    return base.newSeed();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy