public class SecureRandomFactoryBean
extends java.lang.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 |
---|---|
java.security.SecureRandom |
createSecureRandom()
Creates a new
SecureRandom generator using the receiver's
configuration. |
java.lang.String |
getAlgorithm()
Gets the secure random generator algorithm name.
|
java.lang.String |
getProvider()
Gets the JCA provider name for the secure random generator.
|
void |
setAlgorithm(java.lang.String algorithm)
Sets the secure random generator algorithm name.
|
void |
setProvider(java.lang.String provider)
Sets the JCA provider name for the secure random generator.
|
public java.security.SecureRandom createSecureRandom() throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException
SecureRandom
generator using the receiver's
configuration.java.security.NoSuchProviderException
- if the provider name specified by
setProvider(String)
is not known to the platformjava.security.NoSuchAlgorithmException
- 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 java.lang.String getAlgorithm()
SHA1PRNG
); the
SSL.DEFAULT_SECURE_RANDOM_ALGORITHM
is returned if no algorithm has been
specifiedpublic void setAlgorithm(java.lang.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 java.lang.String getProvider()
public void setProvider(java.lang.String provider)
provider
- name of the JCA provider to utilize in creating the
secure random generatorCopyright © 2010 - 2023 Adobe. All Rights Reserved