public class SecureRandomBuilder extends Object
SecureRandomBuilder builds a SecureRandom from the given algorithm and
provider. If nothing is set the default SecureRandom object with the default algorithm
will be build.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ALGORITHM
The Constant DEFAULT_ALGORITHM.
|
| Modifier and Type | Method and Description |
|---|---|
SecureRandomBuilder |
algorithm(String algorithm)
Sets the algorithm.
|
SecureRandom |
build()
Builds a
SecureRandom from the given algorithm and provider. |
SecureRandom |
buildQueitly()
Builds a
SecureRandom from the given algorithm and provider. |
static SecureRandomBuilder |
getInstance()
Gets an instance of
SecureRandomBuilder with the default algorithm and provider. |
static SecureRandomBuilder |
getInstance(String algorithm)
Gets an instance of
SecureRandomBuilder from the given algorithm and provider. |
static SecureRandomBuilder |
getInstance(String algorithm,
String provider)
Gets an instance of
SecureRandomBuilder from the given algorithm and provider. |
SecureRandomBuilder |
provider(String provider)
Sets the provider.
|
public static final String DEFAULT_ALGORITHM
public static SecureRandomBuilder getInstance()
SecureRandomBuilder with the default algorithm and provider.SecureRandomBuilder objectpublic static SecureRandomBuilder getInstance(String algorithm)
SecureRandomBuilder from the given algorithm and provider.algorithm - the algorithmSecureRandomBuilder objectpublic static SecureRandomBuilder getInstance(String algorithm, String provider)
SecureRandomBuilder from the given algorithm and provider.algorithm - the algorithmprovider - the providerSecureRandomBuilder objectpublic SecureRandomBuilder algorithm(@Nonnull String algorithm)
algorithm - the algorithmSecureRandomBuilder object. For chaining.public SecureRandom build() throws NoSuchAlgorithmException, NoSuchProviderException
SecureRandom from the given algorithm and provider. If nothing is set the
default SecureRandom object with the default algorithm will be build.SecureRandom objectNoSuchAlgorithmException - is thrown if a SecureRandomSpi implementation for the specified algorithm is not
available from the specified provider.NoSuchProviderException - is thrown if the specified provider is not registered in the security provider
list.public SecureRandom buildQueitly()
SecureRandom from the given algorithm and provider. If nothing is set the
default SecureRandom object with the default algorithm will be build.SecureRandom objectpublic SecureRandomBuilder provider(@Nonnull String provider)
provider - the providerSecureRandomBuilder object. For chaining.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.