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:
| 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. method.
The mechanism for configuring and installing security providers is
implementation-specific.
Implementation Note
The JDK implementation supports static registration of the security
providers via the conf/security/java.security file in the Java
installation directory. These providers are automatically installed by
the JDK runtime, see The Provider Class
in the Java Cryptography Architecture (JCA) Reference Guide
for information about how a particular type of provider, the cryptographic
service provider, works and is installed.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static enum | |
| public static class | Provider.
The description of a security service. |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final String | |
| private static final String | |
| private static final Debug | |
| private static final Object[] | |
| private transient Set | |
| private transient int | |
| private final String | info
A description of the provider and its services. |
| private transient boolean | |
| private static final Map | |
| private transient volatile boolean | |
| private transient Map | |
| private final String | name
The provider name. |
| private static final ThreadLocal | |
| private transient Set | |
| private static final long | |
| private transient Map | |
| private transient volatile boolean | |
| private transient volatile Set | |
| private double | version
The provider version number. |
| private String | versionStr
The provider version string. |
| Access | Constructor and Description |
|---|---|
| protected | Provider(String
the provider name. name, double the provider version number. version, String a description of the provider and its services. info)
Deprecated
since 9. use
Provider(String, String, String) instead.
Constructs a |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| private void | |
| private void | |
| private static boolean | |
| public synchronized void | clear()
Overrides java. Implements java. Clears this |
| public synchronized Object | compute(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction)
Overrides java. Overrides default java. Attempts to compute a mapping for the specified key and its
current mapped value (or |
| public synchronized Object | computeIfAbsent(Object key, Function<? super Object, ? extends Object> mappingFunction)
Overrides java. Overrides default java. If the specified key is not already associated with a value (or
is mapped to |
| public synchronized Object | computeIfPresent(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction)
Overrides java. Overrides default java. If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value. |
| public Provider | |
| public Enumeration | elements()
Overrides java. Returns an enumeration of the values in this hashtable. |
| public synchronized Set | entrySet()
Overrides java. Implements java. Returns an unmodifiable Set view of the property entries contained
in this |
| public synchronized void | forEach(BiConsumer<? super Object, ? super Object> action)
Overrides java. Overrides default java. Performs the given action for each entry in this map until all entries have been processed or the action throws an exception. |
| public Object | get(Object key)
Overrides java. Implements java. Returns the value to which the specified key is mapped,
or |
| pack-priv Provider. | |
| private static String | |
| public String | Returns: a description of theProvider and its services.Returns a human-readable description of the |
| public String | |
| public synchronized Object | getOrDefault(Object key, Object defaultValue)
Overrides java. Overrides default java. Returns the value to which the specified key is mapped, or
|
| public String | getProperty(String key)
Overrides java. Searches for the property with the specified key in this property list. |
| public Provider. | Returns: the service describing this Provider's matching service ornull if no such service existsthe type of type, String service requested
(for example, MessageDigest)the case-insensitive algorithm name (or alternate
alias) of the service requested (for example, algorithm)SHA-1)Get the service describing this Provider's implementation of the specified type of this algorithm or alias. |
| public Set | Returns: an unmodifiable Set of all services supported by thisProviderGet an unmodifiable Set of all services supported by
this |
| private static String[] | |
| public double | Returns: the version number for thisProvider.
Deprecated
since 9. use
getVersionStr instead.
Returns the version number for this |
| public String | Returns: the version string for thisProvider.Returns the version string for this |
| private void | |
| private Object | implCompute(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction)
|
| private Object | |
| private Object | implComputeIfPresent(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction)
|
| private Object | |
| private Object | |
| private void | |
| private Object | |
| private Object | |
| private boolean | |
| private void | |
| private boolean | |
| private Object | |
| private void | |
| public boolean | Returns: true if no further configuration is needed,
false otherwise.Check if this |
| public Enumeration | |
| public Set | keySet()
Overrides java. Implements java. Returns an unmodifiable Set view of the property keys contained in
this |
| public synchronized void | load(InputStream
the input stream. inStream)Overrides java. Reads a property list (key and element pairs) from the input stream. |
| public synchronized Object | merge(Object key, Object value, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction)
Overrides java. Overrides default java. If the specified key is not already associated with a value or is
associated with |
| private void | |
| private static double | |
| public synchronized Object | put(Object key, Object value)
Overrides java. Implements java. Sets the |
| public synchronized void | putAll(Map<?, ?> t)
Overrides java. Implements java. Copies all the mappings from the specified Map to this |
| private void | |
| public synchronized Object | putIfAbsent(Object key, Object value)
Overrides java. Overrides default java. If the specified key is not already associated with a value (or is mapped
to |
| private void | putPropertyStrings(Provider.
Put the string properties for this Service in this Provider's Hashtable. |
| protected void | |
| private void | readObject(ObjectInputStream
the in)ObjectInputStream to readHides java. Reads the |
| public synchronized Object | remove(Object key)
Overrides java. Implements java. Removes the |
| public synchronized boolean | remove(Object key, Object value)
Overrides java. Overrides default java. Removes the entry for the specified key only if it is currently mapped to the specified value. |
| private void | removePropertyStrings(Provider.
Remove the string properties for this Service from this Provider's Hashtable. |
| protected void | removeService(Provider.
the Service to be removed sRemove a service previously added using
|
| public synchronized boolean | replace(Object key, Object oldValue, Object newValue)
Overrides java. Overrides default java. Replaces the entry for the specified key only if currently mapped to the specified value. |
| public synchronized Object | replace(Object key, Object value)
Overrides java. Overrides default java. Replaces the entry for the specified key only if it is currently mapped to some value. |
| public synchronized void | replaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function)
Overrides java. Overrides default java. Replaces each entry's value with the result of invoking the given function on that entry, in the order entries are returned by an entry set iterator, until all entries have been processed or the function throws an exception. |
| public String | Returns: the string with the name and the version string for thisProvider.Overrides java. Returns a string with the name and the version string
of this |
| public Collection | values()
Overrides java. Implements java. Returns an unmodifiable Collection view of the property values
contained in this |