Package java.security
Class Provider.Service
java.lang.Object
java.security.Provider.Service
- Enclosing class:
- Provider
public static class Provider.Service extends Object
Service represents a service in the Java Security infrastructure.
Each service describes its type, the algorithm it implements, to which
provider it belongs and other properties.-
Constructor Summary
-
Method Summary
Modifier and Type Method Description StringgetAlgorithm()Returns the name of the algorithm implemented by thisService.StringgetAttribute(String name)Returns the value of the attribute with the specifiedname.StringgetClassName()Returns the name of the class implementing thisService.ProvidergetProvider()Returns theProviderthisServicebelongs to.StringgetType()Returns the type of thisService.ObjectnewInstance(Object constructorParameter)Creates and returns a new instance of the implementation described by thisService.booleansupportsParameter(Object parameter)Indicates whether thisServicesupports the specified constructor parameter.StringtoString()Returns a string containing a concise, human-readable description of thisService.
-
Constructor Details
-
Service
public Service(Provider provider, String type, String algorithm, String className, List<String> aliases, Map<String,String> attributes)Constructs a new instance ofServicewith the given attributes.- Parameters:
provider- the provider to which this service belongs.type- the type of this service (for exampleKeyPairGenerator).algorithm- the algorithm this service implements.className- the name of the class implementing this service.aliases-Listof aliases for the algorithm name, ornullif the implemented algorithm has no aliases.attributes-Mapof additional attributes, ornullif thisServicehas no attributed.- Throws:
NullPointerException- ifprovider, type, algorithmorclassNameisnull.
-
-
Method Details
-
getType
Returns the type of thisService. For exampleKeyPairGenerator.- Returns:
- the type of this
Service.
-
getAlgorithm
Returns the name of the algorithm implemented by thisService.- Returns:
- the name of the algorithm implemented by this
Service.
-
getProvider
Returns theProviderthisServicebelongs to.- Returns:
- the
ProviderthisServicebelongs to.
-
getClassName
Returns the name of the class implementing thisService.- Returns:
- the name of the class implementing this
Service.
-
getAttribute
Returns the value of the attribute with the specifiedname.- Parameters:
name- the name of the attribute.- Returns:
- the value of the attribute, or
nullif no attribute with the given name is set. - Throws:
NullPointerException- ifnameisnull.
-
newInstance
Creates and returns a new instance of the implementation described by thisService.- Parameters:
constructorParameter- the parameter that is used by the constructor, ornullif the implementation does not declare a constructor parameter.- Returns:
- a new instance of the implementation described by this
Service. - Throws:
NoSuchAlgorithmException- if the instance could not be constructed.InvalidParameterException- if the implementation does not support the specifiedconstructorParameter.
-
supportsParameter
Indicates whether thisServicesupports the specified constructor parameter.- Parameters:
parameter- the parameter to test.- Returns:
trueif thisServicesupports the specified constructor parameter,falseotherwise.
-
toString
Returns a string containing a concise, human-readable description of thisService.
-