Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-04


oracle.security.crypto.core
Class SREntropySource

java.lang.Object
  extended by oracle.security.crypto.core.EntropySource
      extended by oracle.security.crypto.core.SREntropySource


public class SREntropySource
extends EntropySource

An implementation of the EntropySource abstract class that wraps the generateSeed(int) or getSeed(int) method of the java.security.SecureRandom class.

If the generateSeed(int) method is available, it will be used to generate random bytes, otherwise the static getSeed(int) method will be used. This is done as an accommodation for older JDK's that did not support the generateSeed(int) instance method.

Since:
2.2.3

Constructor Summary
SREntropySource()
          Creates a new SREntropySource instance that wraps a java.security.SecureRandom instance that was obtained by making a call to new java.lang.Securerandom().
SREntropySource(java.security.SecureRandom random)
          Creates a new SREntropySource instance that wraps the given java.security.SecureRandom instance.

 

Method Summary
 void clear()
          This method has no effect on the underlying java.security.SecureRandom instance.
 byte generateByte()
          Generates a byte of seeding material using the SecureRandom.generateSeed(int) or SecureRandom.getSeed(int) method depending on whether generateSeed(int) is available.
 byte[] generateBytes(byte[] bytes)
          Supplies the requisite number of bytes by calling SecureRandom.generateSeed(int) or SecureRandom.getSeed(int) method depending on whether generateSeed(int) is available, and copying the resulting bytes into the given array.

 

Methods inherited from class oracle.security.crypto.core.EntropySource
getDefault, setDefault

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

SREntropySource

public SREntropySource()
Creates a new SREntropySource instance that wraps a java.security.SecureRandom instance that was obtained by making a call to new java.lang.Securerandom().

SREntropySource

public SREntropySource(java.security.SecureRandom random)
Creates a new SREntropySource instance that wraps the given java.security.SecureRandom instance.

If the generateSeed(int) method is available, it will be used to generate entropic bytes, otherwise the static getSeed(int) method will be used. This is done as an accomodation for older JDK's that did not support the generateSeed(int) instance method.

Method Detail

generateByte

public byte generateByte()
Generates a byte of seeding material using the SecureRandom.generateSeed(int) or SecureRandom.getSeed(int) method depending on whether generateSeed(int) is available.
Specified by:
generateByte in class EntropySource

clear

public void clear()
This method has no effect on the underlying java.security.SecureRandom instance.
Specified by:
clear in class EntropySource

generateBytes

public byte[] generateBytes(byte[] bytes)
Supplies the requisite number of bytes by calling SecureRandom.generateSeed(int) or SecureRandom.getSeed(int) method depending on whether generateSeed(int) is available, and copying the resulting bytes into the given array.
Overrides:
generateBytes in class EntropySource

Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-04


Copyright © 2005, 2011 , Oracle. All rights reserved.