This class represents a "provider" for the Java Security API, where a provider implements some or all parts of Java Security. Services that a provider may implement include:
- Algorithms (such as DSA, RSA, or SHA-256).
- Key generation, conversion, and management facilities (such as for algorithm-specific keys).
Some provider implementations may encounter unrecoverable internal errors during their operation, for example a failure to communicate with a security token. A ProviderException
should be used to indicate such errors.
Please note that a provider can be used to implement any security service in Java that uses a pluggable architecture with a choice of implementations that fit underneath.
The service type Provider
is reserved for use by the security framework. Services of this type cannot be added, removed, or modified by applications. The following attributes are automatically placed in each Provider object:
Attributes Automatically Placed in a Provider Object
Name | Value |
Provider.id name | String.valueOf(provider.getName()) |
Provider.id version | String.valueOf(provider.getVersionStr()) |
Provider.id info | String.valueOf(provider.getInfo()) |
Provider.id className | provider.getClass().getName() |
Each provider has a name and a version string. A provider normally identifies itself with a file named java.security.Provider
in the resource directory META-INF/services
. Security providers are looked up via the ServiceLoader
mechanism using the application class loader
.
Providers may be configured such that they are automatically installed and made available at runtime via the Security.getProviders()
method. The mechanism for configuring and installing security providers is implementation-specific.