generateSeed() on
the SecureRandom instance.public final class SeedGenerator extends SeedGenerator
seedGenListener| Constructor and Description |
|---|
SeedGenerator()
Deprecated.
Instantiates a
SeedGenerator object. |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getCurrentTimeSeed()
Deprecated.
Gets a seed based on the current time.
|
byte[] |
getMemorySeed()
Deprecated.
Gets a seed based on current free memory and the total memory allocated
to the Java Virtual Machine (JVM).
|
byte[] |
getMetaSeed(int bytesNeeded)
Deprecated.
|
byte[] |
getSeed()
Deprecated.
Gets the generated random seed bits.
|
int[] |
getStatus()
Deprecated.
Gets the current status of seed generation.
|
byte[] |
getStrongSeed(byte[] externalSeed)
Deprecated.
Gets a cryptographically strong seed based on several different seed
sources and on an external seed when available.
|
byte[] |
getTimingSeed(int bitsNeeded)
Deprecated.
Gets a thread-timing based random number seed.
|
callSeedGenListener, getDefault, getDefaultSeedGenerator, longToBytes, seedAvailable, setDefault, setDefaultSeedGenerator, setSeedGenListenerpublic SeedGenerator()
SeedGenerator object.public byte[] getSeed()
Some seed generators might require a special procedure before getSeed()
can be called. If the seed is not yet available this method returns
null. If the method is called after the seed has been fetched
once, it returns the seed a second time.
getSeed in class SeedGeneratorpublic int[] getStatus()
Returns an array of two integers. The first array indicates how many
random bits have already been generated. The secondarray gives the total
number of random bits to be generated. By definition, if
getStatus()[0] equals getStatus()[1], the seed
is ready to be fetched using getSeed().
getStatus in class SeedGeneratorpublic byte[] getStrongSeed(byte[] externalSeed)
externalSeed - to be used for creating the strong seed.
Precondition:
Can be null.
Postcondition:
Cannot be null.
public byte[] getMemorySeed()
nullpublic byte[] getMetaSeed(int bytesNeeded)
public byte[] getCurrentTimeSeed()
nullpublic byte[] getTimingSeed(int bitsNeeded)
This method returns a random number seed generated by thread-based timing methods alone. It has been proven to work well on a variety of operating systems.
bitsNeeded - the number of bits of entropy required