public class SecureRandomFactoryBean extends Object
SecureRandom generator.
This object holds the configurable properties of a secure random generator
and uses them to create and load a SecureRandom instance.
| Constructor and Description |
|---|
SecureRandomFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
SecureRandom |
createSecureRandom()
Creates a new
SecureRandom generator using the receiver's
configuration. |
String |
getAlgorithm()
Gets the secure random generator algorithm name.
|
String |
getProvider()
Gets the JCA provider name for the secure random generator.
|
void |
setAlgorithm(String algorithm)
Sets the secure random generator algorithm name.
|
void |
setProvider(String provider)
Sets the JCA provider name for the secure random generator.
|
public SecureRandom createSecureRandom() throws NoSuchProviderException, NoSuchAlgorithmException
SecureRandom generator using the receiver's
configuration.NoSuchProviderException - if the provider name specified by
setProvider(String) is not known to the platformNoSuchAlgorithmException - if the algorithm name specified by
setAlgorithm(String) is not recognized by the specified
provider (or the platform's default provider if the provider isn't
specified)public String getAlgorithm()
SHA1PRNG); the
SSL.DEFAULT_SECURE_RANDOM_ALGORITHM is returned if no algorithm has been
specifiedpublic void setAlgorithm(String algorithm)
algorithm - an algorithm name, which must be recognized by the
provider specified via setProvider(String) or by the
platform's default provider if no provider is specified.public String getProvider()
public void setProvider(String provider)
provider - name of the JCA provider to utilize in creating the
secure random generatorCopyright © 2005–2014 QOS.ch. All rights reserved.