public static enum CryptoRandomFactory.RandomProvider extends Enum<CryptoRandomFactory.RandomProvider>
Usage:
props.setProperty(CryptoRandomFactory.CLASSES_KEY, RandomProvider.OPENSSL.getClassName()); props.setProperty(...); // if required by the implementation random = CryptoRandomFactory.getCryptoRandom(transformation, props);
Enum Constant and Description |
---|
JAVA
The SecureRandom implementation from the JVM
|
OPENSSL
The OpenSSL Random implementation (using JNI)
|
OS
The OS random device implementation.
|
Modifier and Type | Method and Description |
---|---|
String |
getClassName()
Gets the class name of the provider.
|
Class<? extends CryptoRandom> |
getImplClass()
Gets the implementation class of the provider.
|
static CryptoRandomFactory.RandomProvider |
valueOf(String name)
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.
|
public static final CryptoRandomFactory.RandomProvider OPENSSL
No properties are used for configuration, but they
are passed to the JAVA
backup implementation
public static final CryptoRandomFactory.RandomProvider JAVA
Uses the property with key
CryptoRandomFactory.JAVA_ALGORITHM_KEY
with the default of
CryptoRandomFactory.JAVA_ALGORITHM_DEFAULT
public static final CryptoRandomFactory.RandomProvider OS
Uses CryptoRandomFactory.DEVICE_FILE_PATH_KEY
to determine the
path to the random device, default is
CryptoRandomFactory.DEVICE_FILE_PATH_DEFAULT
public static CryptoRandomFactory.RandomProvider[] values()
for (CryptoRandomFactory.RandomProvider c : CryptoRandomFactory.RandomProvider.values()) System.out.println(c);
public static CryptoRandomFactory.RandomProvider valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getClassName()
public Class<? extends CryptoRandom> getImplClass()
Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.