All Packages Class Hierarchy This Package Previous Next Index
Class java.security.Provider
java.lang.Object
|
+----java.util.Dictionary
|
+----java.util.Hashtable
|
+----java.util.Properties
|
+----java.security.Provider
- public class Provider
- extends Properties
This class represents a Security Package Provider (SPP) for the
JavaSecurity API. A provider implements some or all parts of
JavaSecurity, including:
- Algorithms (such as DSA, RSA, MD5 or SHA).
- Key Management facilities (such as algorithm-specific keys).
Each provider has a name and a version number, and is configured
in each runtime it is installed in.
There is a default provider that comes standard with the JDK. It is
called the Sun Security Provider.
To register a provider, you must
- Create a subclass of this Provider class. The constructor of the
subclass must set the values of various properties that are required
for the JavaSecurity API to look up the algorithms or other facilities
implemented by the provider. That is, it must specify the names of
the classes implementing the algorithms. For example, for each signature
algorithm implemented by a provider, there must be a property named
Sig.algName
(where algName is the name of the algorithm) whose value
is the name of the class implementing the algorithm. (See
algorithm names
for the standard algorithm names to be used.)
As an example, the Sun Security Provider implements a
Digital Signature Algorithm (DSA) in a class named DSA
in the sun.security.provider package. So its subclass of
Provider (which is sun.security.provider.Sun) sets the
Sig.DSA property via the following:
put("Sig.DSA", "sun.security.provider.DSA")
Note: The Provider subclass can get its information from wherever it
wants. Thus, the information can be hard-wired in, or retrieved at
runtime, e.g., from a file.
- Specify the Provider subclass name and priority in the java.security
file in
java.home/lib/security. For example, the
Sun Security Provider's subclass named Sun is specified via
security.provider.1=sun.security.provider.Sun
(The number 1 is used for the default provider.)
See the "Security Package Providers" section in Security in JDK1.1
for more information.
-
Provider(String, double, String)
- Constructs a provider with the specified name and version number.
-
getInfo()
- Returns a human-readable description of the provider and its
services.
-
getName()
- Returns the name of this provider.
-
getVersion()
- Returns the version number for this provider.
-
toString()
- Returns a printable string with the name and the version number
for this provider.
Provider
protected Provider(String name,
double version,
String info)
- Constructs a provider with the specified name and version number.
- Parameters:
- name - the provider name.
- version - the provider version number.
getName
public String getName()
- Returns the name of this provider.
- Returns:
- the name of this provider.
getVersion
public double getVersion()
- Returns the version number for this provider.
- Returns:
- the version number for this provider.
getInfo
public String getInfo()
- Returns a human-readable description of the provider and its
services. This may return an HTML page, with relevant links.
- Returns:
- a description of the provider and its services.
toString
public String toString()
- Returns a printable string with the name and the version number
for this provider.
- Returns:
- the string with the name and the version number
for this provider.
- Overrides:
- toString in class Hashtable
All Packages Class Hierarchy This Package Previous Next Index