Package java.security
Class Provider.Service
- java.lang.Object
-
- java.security.Provider.Service
-
-
Method Summary
All Methods Instance Methods Concrete Methods 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 Detail
-
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 Detail
-
getType
public final String getType()
Returns the type of thisService. For exampleKeyPairGenerator.- Returns:
- the type of this
Service.
-
getAlgorithm
public final String getAlgorithm()
Returns the name of the algorithm implemented by thisService.- Returns:
- the name of the algorithm implemented by this
Service.
-
getProvider
public final Provider getProvider()
Returns theProviderthisServicebelongs to.- Returns:
- the
ProviderthisServicebelongs to.
-
getClassName
public final String getClassName()
Returns the name of the class implementing thisService.- Returns:
- the name of the class implementing this
Service.
-
getAttribute
public final String getAttribute(String name)
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
public Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException
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
public boolean supportsParameter(Object parameter)
Indicates whether thisServicesupports the specified constructor parameter.- Parameters:
parameter- the parameter to test.- Returns:
trueif thisServicesupports the specified constructor parameter,falseotherwise.
-
-