|
Oracle Security Developer Tools Crypto Java API Reference 10g Release 2 (10.1.2.0.2) B15565-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.RandomBitsSource
An abstract class representing secure PRNG (pseudo-random number generator) implementations.
Please note that, by the very nature of PRNGs, the security of their output depends crucially on the amount and "quality" of seeding entropy used. Implementing classes should provide guidance as to their proper initialization and use.
EntropySource
, SpinnerEntropySource
Constructor Summary | |
protected |
RandomBitsSource() |
Method Summary | |
abstract void |
clear() Clears out sensitive data pools within the PRNG. |
static RandomBitsSource |
getDefault() Get the default random bits source. |
java.math.BigInteger |
randomBigInteger(int len) Provided as an alternative to BigInteger(int, java.util.Random) . |
abstract byte |
randomByte() Generate a random byte. |
byte[] |
randomBytes(byte[] bytes) Fill a byte array with random bytes. |
void |
seed() Seed from the system default entropy source. |
abstract void |
seed(byte[] seed) Seed the PRNG with the supplied array of bytes. |
abstract void |
seed(EntropySource egs) Seed the PRNG with a default number of bytes from the supplied entropy source.\ |
static void |
setDefault(RandomBitsSource rbs) Sets the default random bits source for the current run-time environment. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected RandomBitsSource()
Method Detail |
public abstract void seed(byte[] seed)
public abstract void seed(EntropySource egs)
Note that entropy source algorithms are frequently time and/or resource-intensive, which may cause significant delay before this method returns.
public void seed()
public abstract byte randomByte()
public byte[] randomBytes(byte[] bytes)
public java.math.BigInteger randomBigInteger(int len)
BigInteger(int, java.util.Random)
. Returns a BigInteger uniformly distributed within the interval of the requested length (polling for as many random bytes from the random bits source as necessary). (Note that, as a consequence, the bit length of the returned integer will -- exactly half the time -- be less than the length requested.)public static RandomBitsSource getDefault()
getDefault
will return additional references to the same RandomBitsSource
instance. This must be taken into consideration by programmers developing multi-threaded applications.setDefault(oracle.security.crypto.core.RandomBitsSource)
public static void setDefault(RandomBitsSource rbs)
getDefault()
public abstract void clear()
|
Oracle Security Developer Tools Crypto Java API Reference 10g Release 2 (10.1.2.0.2) B15565-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |