Package org.bouncycastle.crypto.general
Class X931PRNG.Base
- java.lang.Object
-
- org.bouncycastle.crypto.general.X931PRNG.Base
-
- All Implemented Interfaces:
Parameters
- Enclosing class:
- X931PRNG
public static class X931PRNG.Base extends java.lang.Object implements Parameters
Base for Builder for SecureRandom objects based on the X9.31 PRNG.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description X931PRNG.Builder
fromDefaultEntropy()
Return a builder using an EntropySourceProvider based on the default SecureRandom with predictionResistant set to false.X931PRNG.Builder
fromEntropySource(java.security.SecureRandom entropySource, boolean predictionResistant)
Return a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value for prediction resistance.X931PRNG.Builder
fromEntropySource(EntropySourceProvider entropySourceProvider)
Return a builder which makes creates the SecureRandom objects from a specified entropy source provider.Algorithm
getAlgorithm()
Return the algorithm these parameters are associated with.
-
-
-
Method Detail
-
fromDefaultEntropy
public X931PRNG.Builder fromDefaultEntropy()
Return a builder using an EntropySourceProvider based on the default SecureRandom with predictionResistant set to false.Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if the default SecureRandom does for its generateSeed() call.
- Returns:
- a new Builder instance.
-
fromEntropySource
public X931PRNG.Builder fromEntropySource(java.security.SecureRandom entropySource, boolean predictionResistant)
Return a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value for prediction resistance.Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if the passed in SecureRandom does for its generateSeed() call.
- Parameters:
entropySource
- a SecureRandom to use as a source of entropy for the PRNG.predictionResistant
- true if the SecureRandom should be regarded as prediction resistant, false otherwise.- Returns:
- a new builder instance.
-
fromEntropySource
public X931PRNG.Builder fromEntropySource(EntropySourceProvider entropySourceProvider)
Return a builder which makes creates the SecureRandom objects from a specified entropy source provider.Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored.
- Parameters:
entropySourceProvider
- a provider of EntropySource objects.- Returns:
- a new builder instance.
-
getAlgorithm
public Algorithm getAlgorithm()
Description copied from interface:Parameters
Return the algorithm these parameters are associated with.- Specified by:
getAlgorithm
in interfaceParameters
- Returns:
- the algorithm these parameters are for.
-
-