Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.core
Class SREntropySource

`java.lang.Object
oracle.security.crypto.core.EntropySource
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 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.

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()`.

  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.

### 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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