API java : Provider.Service


java.security
Class Provider.Service

java.lang.Object
  extended by 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() and newInstance() which are used by the Java security framework when it searches for suitable services and instantes them. The valid arguments to those methods depend on the type of service. For the service types defined within J2SE, see the Java Cryptography Architecture API Specification & Reference for the valid values. Note that components outside of J2SE can define additional types of services and their behavior.

Instances of this class are immutable.

Since:
1.5

Constructor Summary
Provider.Service(Provider provider, String type, String algorithm, String className, List<String> aliases, Map<String,String> attributes)
          Construct a new service.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 service
type - the type of this service
algorithm - the algorithm name
className - the name of the class implementing this service
aliases - List of aliases or null if algorithm has no aliases
attributes - 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 instantation 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

toString

public String toString()
Return a String representation of this service.

Overrides:
toString in class Object
Returns:
a String representation of this service.

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

8 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-1774
Document créé le 30/08/06 22:01, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/security/Provider.Service.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,37 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
En moyenne, chaque personne possède un testicule.

Anonyme
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 21:57, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)