Package org.bouncycastle.crypto.fips
Class FipsDRBG.Builder
java.lang.Object
org.bouncycastle.crypto.fips.FipsDRBG.Builder
- Enclosing class:
- FipsDRBG
Builder for SecureRandom objects based on the FIPS DRBGs.
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(byte[] nonce, boolean predictionResistant) Build a SecureRandom based on a SP 800-90A DRBG.build
(byte[] nonce, boolean predictionResistant, byte[] additionalInput) Build a SecureRandom based on a SP 800-90A DRBG.setEntropyBitsRequired
(int entropyBitsRequired) Set the amount of entropy bits required for seeding and reseeding DRBGs used in building SecureRandom objects.setPersonalizationString
(byte[] personalizationString) Set the personalization string for DRBG SecureRandoms created by this buildersetSecurityStrength
(int securityStrength) Set the security strength required for DRBGs used in building SecureRandom objects.
-
Method Details
-
setPersonalizationString
Set the personalization string for DRBG SecureRandoms created by this builder- Parameters:
personalizationString
- the personalisation string for the underlying DRBG.- Returns:
- the current Builder instance.
-
setSecurityStrength
Set the security strength required for DRBGs used in building SecureRandom objects.- Parameters:
securityStrength
- the security strength (in bits)- Returns:
- the current Builder instance.
-
setEntropyBitsRequired
Set the amount of entropy bits required for seeding and reseeding DRBGs used in building SecureRandom objects.- Parameters:
entropyBitsRequired
- the number of bits of entropy to be requested from the entropy source on each seed/reseed.- Returns:
- the current Builder instance.
-
build
Build a SecureRandom based on a SP 800-90A DRBG.- Parameters:
nonce
- nonce value to use in DRBG construction.predictionResistant
- specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes.- Returns:
- a SecureRandom supported by a DRBG.
-
build
Build a SecureRandom based on a SP 800-90A DRBG.- Parameters:
nonce
- nonce value to use in DRBG construction.predictionResistant
- specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes.additionalInput
- initial additional input to be used for generating the initial continuous health check block by the DRBG.- Returns:
- a SecureRandom supported by a DRBG.
-