Method from java.security.Provider Detail: |
public synchronized void clear() {
check("clearProviderProperties."+name);
if (debug != null) {
debug.println("Remove " + name + " provider properties");
}
implClear();
}
Clears this provider so that it no longer contains the properties
used to look up facilities implemented by the provider.
First, if there is a security manager, its
checkSecurityAccess method is called with the string
"clearProviderProperties."+name (where name
is the provider name) to see if it's ok to clear this provider.
If the default implementation of checkSecurityAccess
is used (that is, that method is not overriden), then this results in
a call to the security manager's checkPermission method
with a SecurityPermission("clearProviderProperties."+name)
permission. |
public Enumeration<Object> elements() {
checkInitialized();
return super.elements();
}
|
public synchronized Set<Object, Object> entrySet() {
checkInitialized();
if (entrySet == null) {
if (entrySetCallCount++ == 0) // Initial call
entrySet = Collections.unmodifiableMap(this).entrySet();
else
return super.entrySet(); // Recursive call
}
// This exception will be thrown if the implementation of
// Collections.unmodifiableMap.entrySet() is changed such that it
// no longer calls entrySet() on the backing Map. (Provider's
// entrySet implementation depends on this "implementation detail",
// which is unlikely to change.
if (entrySetCallCount != 2)
throw new RuntimeException("Internal error.");
return entrySet;
}
Returns an unmodifiable Set view of the property entries contained
in this Provider. |
public Object get(Object key) {
checkInitialized();
return super.get(key);
}
|
public String getInfo() {
return info;
}
Returns a human-readable description of the provider and its
services. This may return an HTML page, with relevant links. |
public String getName() {
return name;
}
Returns the name of this provider. |
public String getProperty(String key) {
checkInitialized();
return super.getProperty(key);
}
|
public synchronized Service getService(String type,
String algorithm) {
checkInitialized();
// avoid allocating a new key object if possible
ServiceKey key = previousKey;
if (key.matches(type, algorithm) == false) {
key = new ServiceKey(type, algorithm, false);
previousKey = key;
}
if (serviceMap != null) {
Service service = serviceMap.get(key);
if (service != null) {
return service;
}
}
ensureLegacyParsed();
return (legacyMap != null) ? legacyMap.get(key) : null;
}
Get the service describing this Provider's implementation of the
specified type of this algorithm or alias. If no such
implementation exists, this method returns null. If there are two
matching services, one added to this provider using
putService() and one added via put() ,
the service added via putService() is returned. |
public synchronized Set<Service> getServices() {
checkInitialized();
if (legacyChanged || servicesChanged) {
serviceSet = null;
}
if (serviceSet == null) {
ensureLegacyParsed();
Set< Service > set = new LinkedHashSet< >();
if (serviceMap != null) {
set.addAll(serviceMap.values());
}
if (legacyMap != null) {
set.addAll(legacyMap.values());
}
serviceSet = Collections.unmodifiableSet(set);
servicesChanged = false;
}
return serviceSet;
}
Get an unmodifiable Set of all services supported by
this Provider. |
public double getVersion() {
return version;
}
Returns the version number for this provider. |
public Set<Object> keySet() {
checkInitialized();
return Collections.unmodifiableSet(super.keySet());
}
Returns an unmodifiable Set view of the property keys contained in
this provider. |
public Enumeration<Object> keys() {
checkInitialized();
return super.keys();
}
|
public synchronized void load(InputStream inStream) throws IOException {
check("putProviderProperty."+name);
if (debug != null) {
debug.println("Load " + name + " provider properties");
}
Properties tempProperties = new Properties();
tempProperties.load(inStream);
implPutAll(tempProperties);
}
Reads a property list (key and element pairs) from the input stream. |
public synchronized Object put(Object key,
Object value) {
check("putProviderProperty."+name);
if (debug != null) {
debug.println("Set " + name + " provider property [" +
key + "/" + value +"]");
}
return implPut(key, value);
}
Sets the key property to have the specified
value .
First, if there is a security manager, its
checkSecurityAccess method is called with the string
"putProviderProperty."+name , where name is the
provider name, to see if it's ok to set this provider's property values.
If the default implementation of checkSecurityAccess
is used (that is, that method is not overriden), then this results in
a call to the security manager's checkPermission method
with a SecurityPermission("putProviderProperty."+name)
permission. |
public synchronized void putAll(Map<?, ?> t) {
check("putProviderProperty."+name);
if (debug != null) {
debug.println("Put all " + name + " provider properties");
}
implPutAll(t);
}
Copies all of the mappings from the specified Map to this provider.
These mappings will replace any properties that this provider had
for any of the keys currently in the specified Map. |
protected synchronized void putService(Service s) {
check("putProviderProperty." + name);
if (debug != null) {
debug.println(name + ".putService(): " + s);
}
if (s == null) {
throw new NullPointerException();
}
if (s.getProvider() != this) {
throw new IllegalArgumentException
("service.getProvider() must match this Provider object");
}
if (serviceMap == null) {
serviceMap = new LinkedHashMap< ServiceKey,Service >();
}
servicesChanged = true;
String type = s.getType();
String algorithm = s.getAlgorithm();
ServiceKey key = new ServiceKey(type, algorithm, true);
// remove existing service
implRemoveService(serviceMap.get(key));
serviceMap.put(key, s);
for (String alias : s.getAliases()) {
serviceMap.put(new ServiceKey(type, alias, true), s);
}
putPropertyStrings(s);
}
Add a service. If a service of the same type with the same algorithm
name exists and it was added using putService() ,
it is replaced by the new service.
This method also places information about this service
in the provider's Hashtable values in the format described in the
Java Cryptography Architecture API Specification & Reference .
Also, if there is a security manager, its
checkSecurityAccess method is called with the string
"putProviderProperty."+name , where name is
the provider name, to see if it's ok to set this provider's property
values. If the default implementation of checkSecurityAccess
is used (that is, that method is not overriden), then this results in
a call to the security manager's checkPermission method with
a SecurityPermission("putProviderProperty."+name)
permission. |
public synchronized Object remove(Object key) {
check("removeProviderProperty."+name);
if (debug != null) {
debug.println("Remove " + name + " provider property " + key);
}
return implRemove(key);
}
Removes the key property (and its corresponding
value ).
First, if there is a security manager, its
checkSecurityAccess method is called with the string
"removeProviderProperty."+name , where name is
the provider name, to see if it's ok to remove this provider's
properties. If the default implementation of
checkSecurityAccess is used (that is, that method is not
overriden), then this results in a call to the security manager's
checkPermission method with a
SecurityPermission("removeProviderProperty."+name)
permission. |
protected synchronized void removeService(Service s) {
check("removeProviderProperty." + name);
if (debug != null) {
debug.println(name + ".removeService(): " + s);
}
if (s == null) {
throw new NullPointerException();
}
implRemoveService(s);
}
Remove a service previously added using
putService() . The specified service is removed from
this provider. It will no longer be returned by
getService() and its information will be removed
from this provider's Hashtable.
Also, if there is a security manager, its
checkSecurityAccess method is called with the string
"removeProviderProperty."+name , where name is
the provider name, to see if it's ok to remove this provider's
properties. If the default implementation of
checkSecurityAccess is used (that is, that method is not
overriden), then this results in a call to the security manager's
checkPermission method with a
SecurityPermission("removeProviderProperty."+name)
permission. |
public String toString() {
return name + " version " + version;
}
Returns a string with the name and the version number
of this provider. |
public Collection<Object> values() {
checkInitialized();
return Collections.unmodifiableCollection(super.values());
}
Returns an unmodifiable Collection view of the property values
contained in this provider. |