Package org.bouncycastle.crypto.general
Class X931PRNG.Builder
java.lang.Object
org.bouncycastle.crypto.general.X931PRNG.Builder
- Enclosing class:
- X931PRNG
Builder for SecureRandom objects based on the X9.31 PRNG.
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(SymmetricKey key, boolean predictionResistant) Construct a X9.31 secure random generator using the passed in engine and key.setDateTimeVector
(byte[] dateTimeVector) Set the dateTime vector to be used with the generator.
-
Method Details
-
setDateTimeVector
Set the dateTime vector to be used with the generator. If this method is not called a vector is calculated based on System.currentTimeMillis().- Parameters:
dateTimeVector
- a dateTime vector - needs to be the same size as the block size of the cipher.- Returns:
- the current Builder instance.
-
build
Construct a X9.31 secure random generator using the passed in engine and key. If predictionResistant is true the generator will be reseeded on each request.- Parameters:
key
- the block cipher key to initialise algorithm implementation with.predictionResistant
- true if engine to be reseeded on each use, false otherwise.- Returns:
- a SecureRandom.
-