Provider

public abstract class Provider extends Properties

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, MD5 or SHA-1).
  • Key generation, conversion, and management facilities (such as for algorithm-specific keys).

Each provider has a name and a version number, and is configured in each runtime it is installed in.

See The Provider Class in the "Java Cryptography Architecture API Specification & Reference" for information about how a particular type of provider, the cryptographic service provider, works and is installed. However, 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.

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.

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:

NameValue
Provider.id name String.valueOf(provider.getName())
Provider.id version String.valueOf(provider.getVersion())
Provider.id info String.valueOf(provider.getInfo())
Provider.id className provider.getClass().getName()

Nested Class Summary

class Provider.Service The description of a security service. 

Inherited Field Summary

Protected Constructor Summary

Provider(String name, double version, String info)
Constructs a provider with the specified name, version number, and information.

Public Method Summary

synchronized void
clear()
Clears this provider so that it no longer contains the properties used to look up facilities implemented by the provider.
Enumeration<Object>
elements()
Returns an enumeration of the values in this hashtable.
synchronized Set<Entry<ObjectObject>>
entrySet()
Returns an unmodifiable Set view of the property entries contained in this Provider.
synchronized void
forEach(BiConsumer<? super Object, ? super Object> action)
Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.
Object
get(Object key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
String
getInfo()
Returns a human-readable description of the provider and its services.
String
getName()
Returns the name of this provider.
String
getProperty(String key)
Searches for the property with the specified key in this property list.
synchronized Provider.Service
getService(String type, String algorithm)
Get the service describing this Provider's implementation of the specified type of this algorithm or alias.
synchronized Set<Provider.Service>
getServices()
Get an unmodifiable Set of all services supported by this Provider.
double
getVersion()
Returns the version number for this provider.
Set<Object>
keySet()
Returns an unmodifiable Set view of the property keys contained in this provider.
Enumeration<Object>
keys()
Returns an enumeration of the keys in this hashtable.
synchronized void
load(InputStream inStream)
Reads a property list (key and element pairs) from the input stream.
synchronized Object
put(Object key, Object value)
Sets the key property to have the specified value.
synchronized void
putAll(Map<?, ?> t)
Copies all of the mappings from the specified Map to this provider.
synchronized Object
remove(Object key)
Removes the key property (and its corresponding value).
String
toString()
Returns a string with the name and the version number of this provider.
Collection<Object>
values()
Returns an unmodifiable Collection view of the property values contained in this provider.

Protected Method Summary

synchronized void
putService(Provider.Service s)
Add a service.
synchronized void
removeService(Provider.Service s)
Remove a service previously added using putService().

Inherited Method Summary