Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.security.Security
Method Summary | |
static int |
|
static String |
|
static Set |
|
static String |
|
static Provider |
|
static Provider[] |
|
static Provider[] |
|
static Provider[] |
|
static int |
|
static void |
|
static void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static int addProvider(Provider provider)
- Parameters:
provider
- the newProvider
to append.
- Returns:
- the position (starting from 1) of
provider
in the current list ofProvider
s, or-1
ifprovider
was already there.
- Throws:
SecurityException
- if aSecurityManager
is installed and it disallows this operation.
public static String getAlgorithmProperty(String algName, String propName)
Deprecated. Use the provider-based and algorithm-independent
AlgorithmParameters
andKeyFactory
engine classes instead.Returns the value associated to a designated property name for a given algorithm.
- Parameters:
algName
- the algorithm name.propName
- the name of the property to return.
- Returns:
- the value of the specified property or
null
if none found.
public static SetgetAlgorithms(String serviceName)
For a given service (e.g. Signature, MessageDigest, etc...) this method returns theSet
of all available algorithm names (instances ofString
, from all currently installedProvider
s.
- Parameters:
serviceName
- the case-insensitive name of a service (e.g. Signature, MessageDigest, etc).
- Since:
- 1.4
public static String getProperty(String key)
Returns the value associated with a Security propery.
- Parameters:
key
- the key of the property to fetch.
- Returns:
- the value of the Security property associated with
key
. Returnsnull
if no such property was found.
- Throws:
SecurityException
- if aSecurityManager
is installed and it disallows this operation.
- See Also:
setProperty(String,String)
,SecurityPermission
public static Provider getProvider(String name)
Returns an already installedProvider
given its name.
- Parameters:
name
- the name of an already installedProvider
.
- See Also:
removeProvider(String)
,addProvider(Provider)
public static Provider[] getProviders()
Returns the current list of installedProvider
s as an array ordered according to their installation preference order.
- Returns:
- an array of all the installed providers.
public static Provider[] getProviders(Mapfilter)
Returns an array of currently installedProvider
s which satisfy a set of selection criteria.The selection criteria are defined in a
Map
where each element specifies a selection querry. The Keys in thisMap
must be in one of the two following forms:
- <crypto_service>.<algorithm_or_type>: Where crypto_service is a case-insensitive string, similar to what has been described in the
getAlgorithms(String)
method, and algorithm_or_type is a case-insensitive known name of an Algorithm, or one of its aliases. The value of the entry in theMap
for such a Key MUST be the empty string.Provider
s which provide an implementation for the designated service algorithm are included in the result.- <crypto_service>.<algorithm_or_type> <attribute_name>: Where crypto_service is a case-insensitive string, similar to what has been described in the
getAlgorithms(String)
method, algorithm_or_type is a case-insensitive known name of an Algorithm or one of its aliases, and attribute_name is a case-insensitive property name with no whitespace characters, and no dots, in-between. The value of the entry in thisMap
for such a Key MUST NOT benull
or an empty string.Provider
s which declare the designated attribute_name and value for the designated service algorithm are included in the result.
- Parameters:
filter
- aMap
of selection querries.
- Throws:
InvalidParameterException
- if an exception is encountered while parsing the syntax of theMap
's keys.
- See Also:
getProviders(String)
public static Provider[] getProviders(String filter)
Returns an array of currently installedProvider
s, ordered according to their installation preference order, which satisfy a given selection criterion.This implementation recognizes a selection criterion written in one of two following forms:
- <crypto_service>.<algorithm_or_type>: Where crypto_service is a case-insensitive string, similar to what has been described in the
getAlgorithms(String)
method, and algorithm_or_type is a known case-insensitive name of an Algorithm, or one of its aliases.For example, "CertificateFactory.X.509" would return all the installed
Provider
s which provide a CertificateFactory implementation of X.509.- <crypto_service>.<algorithm_or_type> <attribute_name>:<value>: Where crypto_service is a case-insensitive string, similar to what has been described in the
getAlgorithms(String)
method, algorithm_or_type is a case-insensitive known name of an Algorithm or one of its aliases, attribute_name is a case-insensitive property name with no whitespace characters, and no dots, in-between, and value is aString
with no whitespace characters in-between.For example, "Signature.Sha1WithDSS KeySize:1024" would return all the installed
Provider
s which declared their ability to provide Signature services, using the Sha1WithDSS algorithm with key sizes of 1024.
- Parameters:
filter
- the selection criterion for selecting among the installedProvider
s.
- Throws:
InvalidParameterException
- if an exception occurs while parsing thefilter
.
- See Also:
getProviders(Map)
public static int insertProviderAt(Provider provider, int position)
Inserts a new designatedProvider
at a designated (1-based) position in the current list of installedProvider
s,
- Parameters:
provider
- the newProvider
to add.position
- the position (starting from 1) of where to installprovider
.
- Returns:
- the actual position, in the list of installed Providers. Returns
-1
ifprovider
was laready in the list. The actual position may be different than the desiredposition
.
- Throws:
SecurityException
- if aSecurityManager
is installed and it disallows this operation.
public static void removeProvider(String name)
Removes an already installedProvider
, given its name, from the current list of installedProvider
s.
- Parameters:
name
- the name of an already installedProvider
to remove.
- Throws:
SecurityException
- if aSecurityManager
is installed and it disallows this operation.
- See Also:
getProvider(String)
,addProvider(Provider)
public static void setProperty(String key, String datum)
Sets or changes a designated Security property to a designated value.
- Parameters:
key
- the name of the property to set.datum
- the new value of the property.
- Throws:
SecurityException
- if aSecurityManager
is installed and it disallows this operation.
- See Also:
getProperty(String)
,SecurityPermission