|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Random
java.security.SecureRandom
org.bouncycastle.crypto.util.JournalingSecureRandom
A SecureRandom that maintains a journal of its output. This can be used to recreate an output that was based on randomness For the transcript to be reusable, the order of the requests for randomness during recreation must be consistent with the initial requests and no other sources of randomness may be used.
Constructor Summary | |
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. |
Method Summary | |
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 |
Methods inherited from class java.security.SecureRandom |
generateSeed, getInstance, getInstance, getInstance, getProvider, getSeed, next, setSeed, setSeed |
Methods inherited from class java.util.Random |
nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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.Method Detail |
public final void nextBytes(byte[] bytes)
bytes
- a block of bytes to be filled with random data.public void clear()
public void reset()
public byte[] getTranscript()
public byte[] getFullTranscript()
|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |