public class JournalingSecureRandom
extends java.security.SecureRandom
Constructor and Description |
---|
JournalingSecureRandom()
Default constructor that takes an arbitrary SecureRandom as initial random
|
JournalingSecureRandom(byte[] transcript,
java.security.SecureRandom random)
Constructor with a prior transcript.
|
JournalingSecureRandom(java.security.SecureRandom random)
Base constructor - no prior transcript.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the internals
|
byte[] |
getFullTranscript()
Return the full transcript, such as would be needed to create a copy of this JournalingSecureRandom,
|
byte[] |
getTranscript()
Return the transcript so far,
|
void |
nextBytes(byte[] bytes)
Fill bytes with random data, journaling the random data before returning or re-use previously used random data, depending on the state of the transcript.
|
void |
reset()
Resets the index to zero such that the randomness will now be reused
|
generateSeed, getAlgorithm, getInstance, getInstance, getInstance, getInstanceStrong, getProvider, getSeed, next, setSeed, setSeed
public JournalingSecureRandom()
public JournalingSecureRandom(java.security.SecureRandom random)
random
- source of randomness we will be journaling.public JournalingSecureRandom(byte[] transcript, java.security.SecureRandom random)
transcript
- initial transcript of randomness.random
- source of randomness we will be journaling when the transcript runs out.public final void nextBytes(byte[] bytes)
nextBytes
in class java.security.SecureRandom
bytes
- a block of bytes to be filled with random data.public void clear()
public void reset()
public byte[] getTranscript()
public byte[] getFullTranscript()