public final class CryptoServicesRegistrar
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CryptoServicesRegistrar.Property
Available properties that can be set.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Object[] |
clearGlobalProperty(CryptoServicesRegistrar.Property property)
Clear the global value for the passed in property.
|
static java.lang.Object[] |
clearThreadProperty(CryptoServicesRegistrar.Property property)
Clear the thread local value for the passed in property.
|
static java.lang.Object |
getProperty(CryptoServicesRegistrar.Property property)
Return the default value for a particular property if one exists.
|
static java.security.SecureRandom |
getSecureRandom()
Return the default source of randomness.
|
static java.security.SecureRandom |
getSecureRandom(java.security.SecureRandom secureRandom)
Return either the passed-in SecureRandom, or if it is null, then the default source of randomness.
|
static java.lang.Object[] |
getSizedProperty(CryptoServicesRegistrar.Property property)
Return an array representing the current values for a sized property such as DH_DEFAULT_PARAMS or
DSA_DEFAULT_PARAMS.
|
static java.lang.Object |
getSizedProperty(CryptoServicesRegistrar.Property property,
int size)
Return the value for a specific size for a sized property such as DH_DEFAULT_PARAMS or
DSA_DEFAULT_PARAMS.
|
static void |
setGlobalProperty(CryptoServicesRegistrar.Property property,
java.lang.Object[] propertyValue)
Set the value of the the passed in property globally in the JVM.
|
static void |
setSecureRandom(java.security.SecureRandom secureRandom)
Set a default secure random to be used where none is otherwise provided.
|
static void |
setThreadProperty(CryptoServicesRegistrar.Property property,
java.lang.Object[] propertyValue)
Set the value of the the passed in property on the current thread only.
|
public static java.security.SecureRandom getSecureRandom()
java.lang.IllegalStateException
- if no source of randomness has been provided.public static java.security.SecureRandom getSecureRandom(java.security.SecureRandom secureRandom)
secureRandom
- the SecureRandom to use if it is not null.public static void setSecureRandom(java.security.SecureRandom secureRandom)
secureRandom
- the SecureRandom to use as the default.public static java.lang.Object getProperty(CryptoServicesRegistrar.Property property)
property
- the property to look up.public static java.lang.Object[] getSizedProperty(CryptoServicesRegistrar.Property property)
property
- the name of the property to look up.the
- base type of the array to be returned.public static java.lang.Object getSizedProperty(CryptoServicesRegistrar.Property property, int size)
property
- the name of the property to look up.size
- the size (in bits) of the defining value in the property type.public static void setThreadProperty(CryptoServicesRegistrar.Property property, java.lang.Object[] propertyValue)
property
- the name of the property to set.propertyValue
- the values to assign to the property.the
- base type of the property value.public static void setGlobalProperty(CryptoServicesRegistrar.Property property, java.lang.Object[] propertyValue)
property
- the name of the property to set.propertyValue
- the values to assign to the property.public static java.lang.Object[] clearGlobalProperty(CryptoServicesRegistrar.Property property)
property
- the property to be cleared.the
- base type of the property valuepublic static java.lang.Object[] clearThreadProperty(CryptoServicesRegistrar.Property property)
property
- the property to be cleared.the
- base type of the property value