Package java.security
Class Provider
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
- Direct Known Subclasses:
AuthProvider,BouncyCastleProvider,CryptoProvider,DRLCertFactory,JSSEProvider,OpenSSLProvider
public abstract class Provider extends Properties
Provider is the abstract superclass for all security providers in the
Java security infrastructure.- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProvider.ServiceServicerepresents a service in the Java Security infrastructure. -
Field Summary
Fields inherited from class java.util.Properties
defaults -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidclear()Clears all properties used to look up services implemented by thisProvider.Set<Map.Entry<Object,Object>>entrySet()Returns a set of the mappings contained in thisHashtable.StringgetInfo()Returns a description of the services being provided.StringgetName()Returns the name of this provider.Provider.ServicegetService(String type, String algorithm)Returns the service with the specifiedtypeimplementing the specifiedalgorithm, ornullif no such implementation exists.Set<Provider.Service>getServices()Returns an unmodifiableSetof all services registered by this provider.doublegetVersion()Returns the version number for the services being provided.Set<Object>keySet()Returns a set of the keys contained in thisHashtable.voidload(InputStream inStream)Loads properties from the specifiedInputStream, assumed to be ISO-8859-1.Objectput(Object key, Object value)Maps the specifiedkeyproperty name to the specifiedvalue.voidputAll(Map<?,?> t)Copies all from the provided map to thisProvider.protected voidputService(Provider.Service s)Adds aServiceto thisProvider.Objectremove(Object key)Removes the specifiedkeyand its associated value from thisProvider.protected voidremoveService(Provider.Service s)Removes a previously registeredServicefrom thisProvider.StringtoString()Returns a string containing a concise, human-readable description of thisProviderincluding its name and its version.Collection<Object>values()Returns a collection of the values contained in thisHashtable.Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
-
Constructor Details
-
Provider
Constructs a new instance ofProviderwith its name, version and description.- Parameters:
name- the name of the provider.version- the version of the provider.info- a description of the provider.
-
-
Method Details
-
getName
Returns the name of this provider.- Returns:
- the name of this provider.
-
getVersion
public double getVersion()Returns the version number for the services being provided.- Returns:
- the version number for the services being provided.
-
getInfo
Returns a description of the services being provided.- Returns:
- a description of the services being provided.
-
toString
Returns a string containing a concise, human-readable description of thisProviderincluding its name and its version. -
clear
public void clear()Clears all properties used to look up services implemented by thisProvider. -
load
Description copied from class:PropertiesLoads properties from the specifiedInputStream, assumed to be ISO-8859-1. See "Character Encoding".- Overrides:
loadin classProperties- Parameters:
inStream- theInputStream- Throws:
IOException
-
putAll
Copies all from the provided map to thisProvider. -
entrySet
Description copied from class:HashtableReturns a set of the mappings contained in thisHashtable. Each element in the set is aMap.Entry. The set is backed by thisHashtableso changes to one are reflected by the other. The set does not support adding. -
keySet
Description copied from class:HashtableReturns a set of the keys contained in thisHashtable. The set is backed by thisHashtableso changes to one are reflected by the other. The set does not support adding. -
values
Description copied from class:HashtableReturns a collection of the values contained in thisHashtable. The collection is backed by thisHashtableso changes to one are reflected by the other. The collection does not support adding. -
put
Maps the specifiedkeyproperty name to the specifiedvalue.- Specified by:
putin interfaceMap<Object,Object>- Overrides:
putin classHashtable<Object,Object>- Parameters:
key- the name of the property.value- the value of the property.- Returns:
- the value that was previously mapped to the specified
key,ornullif it did not have one. - See Also:
Hashtable.elements(),Hashtable.get(java.lang.Object),Hashtable.keys(),Object.equals(java.lang.Object)
-
remove
Removes the specifiedkeyand its associated value from thisProvider.- Specified by:
removein interfaceMap<Object,Object>- Overrides:
removein classHashtable<Object,Object>- Parameters:
key- the name of the property- Returns:
- the value that was mapped to the specified
key,ornullif no mapping was present - See Also:
Hashtable.get(java.lang.Object),Hashtable.put(K, V)
-
getService
Returns the service with the specifiedtypeimplementing the specifiedalgorithm, ornullif no such implementation exists.If two services match the requested type and algorithm, the one added with the
putService(Service)is returned (as opposed to the one added viaput(Object, Object).- Parameters:
type- the type of the service (for exampleKeyPairGenerator)algorithm- the algorithm name (case insensitive)- Returns:
- the requested service, or
nullif no such implementation exists
-
getServices
Returns an unmodifiableSetof all services registered by this provider.- Returns:
- an unmodifiable
Setof all services registered by this provider
-
putService
Adds aServiceto thisProvider. If a service with the same name was registered via this method, it is replace.- Parameters:
s- theServiceto register
-
removeService
Removes a previously registeredServicefrom thisProvider.- Parameters:
s- theServiceto remove- Throws:
NullPointerException- ifsisnull
-