Top Description Fields Constructors Methods
ch.qos.logback.core.net.ssl

public Class SecureRandomFactoryBean

extends Object
Class Inheritance
Imports
java.security.NoSuchAlgorithmException, .NoSuchProviderException, .SecureRandom

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

Field Summary

Modifier and TypeField and Description
private String
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SecureRandom

Returns:

secure random generator instance
createSecureRandom
()

Creates a new SecureRandom generator using the receiver's configuration.

public String

Returns:

an algorithm name (e.g. SHA1PRNG); the SSL#DEFAULT_SECURE_RANDOM_ALGORITHM is returned if no algorithm has been specified
getAlgorithm
()

Gets the secure random generator algorithm name.

public String

Returns:

provider name
getProvider
()

Gets the JCA provider name for the secure random generator.

public void
setAlgorithm(String
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.
algorithm
)

Sets the secure random generator algorithm name.

public void
setProvider(String
name of the JCA provider to utilize in creating the secure random generator
provider
)

Sets the JCA provider name for the secure random generator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmback to summary
private String algorithm
providerback to summary
private String provider

Constructor Detail

SecureRandomFactoryBeanback to summary
public SecureRandomFactoryBean()

Method Detail

createSecureRandomback to summary
public SecureRandom createSecureRandom() throws NoSuchProviderException, NoSuchAlgorithmException

Creates a new SecureRandom generator using the receiver's configuration.

Returns:SecureRandom

secure random generator instance

Exceptions
NoSuchProviderException:
if the provider name specified by setProvider(String) is not known to the platform
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)
getAlgorithmback to summary
public String getAlgorithm()

Gets the secure random generator algorithm name.

Returns:String

an algorithm name (e.g. SHA1PRNG); the SSL#DEFAULT_SECURE_RANDOM_ALGORITHM is returned if no algorithm has been specified

getProviderback to summary
public String getProvider()

Gets the JCA provider name for the secure random generator.

Returns:String

provider name

setAlgorithmback to summary
public void setAlgorithm(String algorithm)

Sets the secure random generator algorithm name.

Parameters
algorithm:String

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.

setProviderback to summary
public void setProvider(String provider)

Sets the JCA provider name for the secure random generator.

Parameters
provider:String

name of the JCA provider to utilize in creating the secure random generator