java.lang.Object | |
↳ | java.security.Security |
Security
is the central class in the Java Security API. It manages
the list of security Provider
that have been installed into this
runtime environment.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds the given
provider to the collection of providers at the
next available position. | |||||||||||
This method is deprecated.
Use
AlgorithmParameters and KeyFactory
instead.
| |||||||||||
Returns a
Set of all registered algorithms for the specified
cryptographic service. | |||||||||||
Returns the value of the security property named by the argument.
| |||||||||||
Returns the
Provider with the specified name. | |||||||||||
Returns the array of providers which meet the user supplied set of
filters.
| |||||||||||
Returns the array of providers which meet the user supplied string
filter.
| |||||||||||
Returns an array containing all installed providers.
| |||||||||||
Insert the given
Provider at the specified position . | |||||||||||
Removes the
Provider with the specified name form the collection
of providers. | |||||||||||
Sets the value of the specified security property.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Adds the given provider
to the collection of providers at the
next available position.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
insertProvider.NAME
(where NAME is
the provider name) to be granted, otherwise a SecurityException
will be thrown.
provider | the provider to be added. |
---|
-1
if the given provider
was already in the list.SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method.
|
---|
This method is deprecated.
Use AlgorithmParameters
and KeyFactory
instead.
Returns value for the specified algorithm with the specified name.
algName | the name of the algorithm. |
---|---|
propName | the name of the property. |
Returns a Set
of all registered algorithms for the specified
cryptographic service. "Signature"
, "Cipher"
and "KeyStore"
are examples for such kind of services.
serviceName | the case-insensitive name of the service. |
---|
Set
of all registered algorithms for the specified
cryptographic service, or an empty Set
if serviceName
is null
or if no registered provider
provides the requested service.
Returns the value of the security property named by the argument.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
getProperty.KEY
(where KEY is the
specified key
) to be granted, otherwise a SecurityException
will be thrown.
key | the name of the requested security property. |
---|
SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method.
|
---|
Returns the Provider
with the specified name. Returns null
if name is null
or no provider with the specified name is
installed.
name | the name of the requested provider. |
---|
null
.
Returns the array of providers which meet the user supplied set of
filters. The filter must be supplied in one of two formats:
for example: "MessageDigest.SHA" The value associated with the key must
be an empty string.
for example: "Signature.MD2withRSA KeySize:512" where "KeySize:512" is
the value of the filter map entry.
filter | case-insensitive filter. |
---|
filter
. A null
value signifies that none of the
installed providers meets the filter specification.InvalidParameterException | if an unusable filter is supplied. |
---|---|
NullPointerException | if filter is null .
|
Returns the array of providers which meet the user supplied string
filter. The specified filter must be supplied in one of two formats:
(for example: "MessageDigest.SHA")
(for example: "Signature.MD2withRSA KeySize:512")
filter | case-insensitive filter. |
---|
filter
. A null
value signifies that none of the
installed providers meets the filter specification.InvalidParameterException | if an unusable filter is supplied. |
---|---|
NullPointerException | if filter is null .
|
Returns an array containing all installed providers. The providers are ordered according their preference order.
Insert the given Provider
at the specified position
. The
positions define the preference order in which providers are searched for
requested algorithms.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
insertProvider.NAME
(where NAME is
the provider name) to be granted, otherwise a SecurityException
will be thrown.
provider | the provider to insert. |
---|---|
position | the position (starting from 1). |
-1
if the given provider
was already in the list. The actual position may be different
from the desired position.SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method.
|
---|
Removes the Provider
with the specified name form the collection
of providers. If the the Provider
with the specified name is
removed, all provider at a greater position are shifted down one
position.
Returns silently if name
is null
or no provider with the
specified name is installed.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
removeProvider.NAME
(where NAME is
the provider name) to be granted, otherwise a SecurityException
will be thrown.
name | the name of the provider to remove. |
---|
SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method.
|
---|
Sets the value of the specified security property.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
setProperty.KEY
(where KEY is the
specified key
) to be granted, otherwise a SecurityException
will be thrown.
key | the name of the security property. |
---|---|
datnum | the value of the security property. |
SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method.
|
---|