- java.lang.Object
-
- java.security.Provider.Service
-
- Enclosing class:
- Provider
public static class Provider.Service extends Object
The description of a security service. It encapsulates the properties of a service and contains a factory method to obtain new implementation instances of this service.Each service has a provider that offers the service, a type, an algorithm name, and the name of the class that implements the service. Optionally, it also includes a list of alternate algorithm names for this service (aliases) and attributes, which are a map of (name, value) String pairs.
This class defines the methods
supportsParameter()
andnewInstance()
which are used by the Java security framework when it searches for suitable services and instantiates them. The valid arguments to those methods depend on the type of service. For the service types defined within Java SE, see the Java Cryptography Architecture API Specification & Reference for the valid values. Note that components outside of Java SE can define additional types of services and their behavior.Instances of this class are immutable.
- Since:
- 1.5
-
-
Constructor Summary
Constructors Constructor and Description Provider.Service(Provider provider, String type, String algorithm, String className, List<String> aliases, Map<String,String> attributes)
Construct a new service.
-
Method Summary
Methods Modifier and Type Method and Description String
getAlgorithm()
Return the name of the algorithm of this service.String
getAttribute(String name)
Return the value of the specified attribute or null if this attribute is not set for this Service.String
getClassName()
Return the name of the class implementing this service.Provider
getProvider()
Return the Provider of this service.String
getType()
Get the type of this service.Object
newInstance(Object constructorParameter)
Return a new instance of the implementation described by this service.boolean
supportsParameter(Object parameter)
Test whether this Service can use the specified parameter.String
toString()
Return a String representation of this service.
-
-
-
Constructor Detail
-
Provider.Service
public Provider.Service(Provider provider, String type, String algorithm, String className, List<String> aliases, Map<String,String> attributes)
Construct a new service.- Parameters:
provider
- the provider that offers this servicetype
- the type of this servicealgorithm
- the algorithm nameclassName
- the name of the class implementing this servicealiases
- List of aliases or null if algorithm has no aliasesattributes
- Map of attributes or null if this implementation has no attributes- Throws:
NullPointerException
- if provider, type, algorithm, or className is null
-
-
Method Detail
-
getType
public final String getType()
Get the type of this service. For example,MessageDigest
.- Returns:
- the type of this service
-
getAlgorithm
public final String getAlgorithm()
Return the name of the algorithm of this service. For example,SHA-1
.- Returns:
- the algorithm of this service
-
getProvider
public final Provider getProvider()
Return the Provider of this service.- Returns:
- the Provider of this service
-
getClassName
public final String getClassName()
Return the name of the class implementing this service.- Returns:
- the name of the class implementing this service
-
getAttribute
public final String getAttribute(String name)
Return the value of the specified attribute or null if this attribute is not set for this Service.- Parameters:
name
- the name of the requested attribute- Returns:
- the value of the specified attribute or null if the attribute is not present
- Throws:
NullPointerException
- if name is null
-
newInstance
public Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException
Return a new instance of the implementation described by this service. The security provider framework uses this method to construct implementations. Applications will typically not need to call it.The default implementation uses reflection to invoke the standard constructor for this type of service. Security providers can override this method to implement instantiation in a different way. For details and the values of constructorParameter that are valid for the various types of services see the Java Cryptography Architecture API Specification & Reference.
- Parameters:
constructorParameter
- the value to pass to the constructor, or null if this type of service does not use a constructorParameter.- Returns:
- a new implementation of this service
- Throws:
InvalidParameterException
- if the value of constructorParameter is invalid for this type of service.NoSuchAlgorithmException
- if instantiation failed for any other reason.
-
supportsParameter
public boolean supportsParameter(Object parameter)
Test whether this Service can use the specified parameter. Returns false if this service cannot use the parameter. Returns true if this service can use the parameter, if a fast test is infeasible, or if the status is unknown.The security provider framework uses this method with some types of services to quickly exclude non-matching implementations for consideration. Applications will typically not need to call it.
For details and the values of parameter that are valid for the various types of services see the top of this class and the Java Cryptography Architecture API Specification & Reference. Security providers can override it to implement their own test.
- Parameters:
parameter
- the parameter to test- Returns:
- false if this this service cannot use the specified parameter; true if it can possibly use the parameter
- Throws:
InvalidParameterException
- if the value of parameter is invalid for this type of service or if this method cannot be used with this type of service
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-java/security/Provider.Service.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.