Class SecureRandomBuilder
java.lang.Object
com.netflix.spinnaker.kork.crypto.SecureRandomBuilder
Builder class for creating a
SecureRandom instance using a deterministic random bit
generator (DRBG).- See Also:
-
- NIST Special Publication 800-90A Revision 1 (Recommendation for Random Number Generation Using Deterministic Random Bit Generators)
DrbgParameters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a random generator using the settings from this builder.static SecureRandomBuildercreate()Creates a new builder forSecureRandominstances.withAlgorithm(String algorithm) Overrides the algorithm name to use.withPersonalizationString(byte[] personalizationString) Specifies a personalization string to use during instantiation of the random generator.withPersonalizationString(String personalizationString) Specifies a personalization string which is converted to UTF-8.Enables support for prediction resistance (and by extension, reseeding).withProvider(String provider) Specifies a particular security provider name to use.withProvider(Provider provider) Specifies a particular security provider to use.Enables support forSecureRandom.reseed()andSecureRandom.reseed(SecureRandomParameters).withStrength(int bitStrength) Specifies the required security strength in bits for the built random generator.
-
Constructor Details
-
SecureRandomBuilder
public SecureRandomBuilder()
-
-
Method Details
-
withAlgorithm
Overrides the algorithm name to use. By default, this isDRBG. -
withProvider
Specifies a particular security provider name to use. -
withProvider
Specifies a particular security provider to use. -
withStrength
Specifies the required security strength in bits for the built random generator. If set to -1 or otherwise left unspecified, then the default strength will be used depending on the system configuration. The default Sun provider uses a strength of 128.- See Also:
-
withReseedSupport
Enables support forSecureRandom.reseed()andSecureRandom.reseed(SecureRandomParameters). Long-running use of a random generator may periodically desire reseeding from an underlying entropy source. The default Sun provider supports reseeding.- See Also:
-
withPredictionResistance
Enables support for prediction resistance (and by extension, reseeding). The default Sun provider supports prediction resistance.- See Also:
-
withPersonalizationString
Specifies a personalization string to use during instantiation of the random generator. A personalization string is useful for separating different uses of random generators.- See Also:
-
withPersonalizationString
Specifies a personalization string which is converted to UTF-8.- See Also:
-
build
Creates a random generator using the settings from this builder. -
create
Creates a new builder forSecureRandominstances.
-