|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Random
com.mindbright.jca.security.SecureRandom
com.mindbright.util.SecureRandomAndPad
Class for generating both random bytes and pad bytes. The pad bytes are also pseudo-random but generated by a different algorithm (arcfour) and uses a different seed.
Constructor Summary | |
SecureRandomAndPad()
Simple constructor. |
|
SecureRandomAndPad(SecureRandom random)
Creates an instance which uses the given random number generator. |
Method Summary | |
byte[] |
generateSeed(int numBytes)
Generate random seed bytes. |
void |
nextBytes(byte[] bytes)
Fills the given array with random bytes. |
void |
nextPadBytes(byte[] bytes,
int off,
int len)
Get a number of pad bytes. |
void |
setPadSeed(byte[] seed)
Seed the pad generator. |
void |
setSeed(byte[] seed)
Seeds the random number generator. |
Methods inherited from class com.mindbright.jca.security.SecureRandom |
getInstance, getInstance, getProvider, getSeed, next, 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 SecureRandomAndPad()
public SecureRandomAndPad(SecureRandom random)
random
- underlying random number generatorMethod Detail |
public void setPadSeed(byte[] seed)
seed
- array of random data which is used to seed the generatorpublic void nextPadBytes(byte[] bytes, int off, int len)
bytes
- array into which the bytes should be storedoff
- offset to first byte to store in arraylen
- number of pad bytes to storepublic byte[] generateSeed(int numBytes)
generateSeed
in class SecureRandom
numBytes
- how many bytes to generate
public void nextBytes(byte[] bytes)
nextBytes
in class SecureRandom
bytes
- array to fill with random bytespublic void setSeed(byte[] seed)
setSeed
in class SecureRandom
seed
- array of random data which is used to seed the generator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |