Package org.apache.commons.crypto.random
Enum CryptoRandomFactory.RandomProvider
java.lang.Object
java.lang.Enum<CryptoRandomFactory.RandomProvider>
org.apache.commons.crypto.random.CryptoRandomFactory.RandomProvider
- All Implemented Interfaces:
Serializable
,Comparable<CryptoRandomFactory.RandomProvider>
- Enclosing class:
CryptoRandomFactory
public static enum CryptoRandomFactory.RandomProvider
extends Enum<CryptoRandomFactory.RandomProvider>
Defines the internal CryptoRandom implementations.
Usage:
props.setProperty(CryptoRandomFactory.CLASSES_KEY, RandomProvider.OPENSSL.getClassName()); props.setProperty(...); // if required by the implementation random = CryptoRandomFactory.getCryptoRandom(transformation, props);
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final Class
<? extends CryptoRandom> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
RandomProvider
(Class<? extends CryptoRandom> klass) The private constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets the class name of the provider.Class
<? extends CryptoRandom> Gets the implementation class of the provider.Returns the enum constant of this type with the specified name.static CryptoRandomFactory.RandomProvider[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
OPENSSL
The OpenSSL Random implementation (using JNI)No properties are used for configuration, but they are passed to the
JAVA
backup implementation -
JAVA
The SecureRandom implementation from the JVMUses the property with key
CryptoRandomFactory.JAVA_ALGORITHM_KEY
with the default ofCryptoRandomFactory.JAVA_ALGORITHM_DEFAULT
-
OS
The OS random device implementation. May not be available on some OSes.Uses
CryptoRandomFactory.DEVICE_FILE_PATH_KEY
to determine the path to the random device, default isCryptoRandomFactory.DEVICE_FILE_PATH_DEFAULT
-
-
Field Details
-
klass
-
className
-
-
Constructor Details
-
RandomProvider
The private constructor.- Parameters:
klass
- the Class of CryptoRandom
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getClassName
Gets the class name of the provider.- Returns:
- the name of the provider class
-
getImplClass
Gets the implementation class of the provider.- Returns:
- the implementation class of the provider
-