Package ch.qos.logback.core.net.ssl
Class SecureRandomFactoryBean
java.lang.Object
ch.qos.logback.core.net.ssl.SecureRandomFactoryBean
A factory bean for a JCA
SecureRandom generator.
This object holds the configurable properties of a secure random generator
and uses them to create and load a SecureRandom instance.
- Author:
- Carl Harris
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a newSecureRandomgenerator using the receiver's configuration.Gets the secure random generator algorithm name.Gets the JCA provider name for the secure random generator.voidsetAlgorithm(String algorithm) Sets the secure random generator algorithm name.voidsetProvider(String provider) Sets the JCA provider name for the secure random generator.
-
Constructor Details
-
SecureRandomFactoryBean
public SecureRandomFactoryBean()
-
-
Method Details
-
createSecureRandom
Creates a newSecureRandomgenerator using the receiver's configuration.- Returns:
- secure random generator instance
- Throws:
NoSuchProviderException- if the provider name specified bysetProvider(String)is not known to the platformNoSuchAlgorithmException- if the algorithm name specified bysetAlgorithm(String)is not recognized by the specified provider (or the platform's default provider if the provider isn't specified)
-
getAlgorithm
Gets the secure random generator algorithm name.- Returns:
- an algorithm name (e.g.
SHA1PRNG); theSSL.DEFAULT_SECURE_RANDOM_ALGORITHMis returned if no algorithm has been specified
-
setAlgorithm
Sets the secure random generator algorithm name.- Parameters:
algorithm- an algorithm name, which must be recognized by the provider specified viasetProvider(String)or by the platform's default provider if no provider is specified.
-
getProvider
Gets the JCA provider name for the secure random generator.- Returns:
- provider name
-
setProvider
Sets the JCA provider name for the secure random generator.- Parameters:
provider- name of the JCA provider to utilize in creating the secure random generator
-