|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
java.security
|
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 |
---|
public Provider.Service(Provider provider, String type, String algorithm, String className, List<String> aliases, Map<String,String> attributes)
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
NullPointerException
- if provider, type, algorithm, or
className is nullMethod Detail |
---|
public final String getType()
MessageDigest
.
public final String getAlgorithm()
SHA-1
.
public final Provider getProvider()
public final String getClassName()
public final String getAttribute(String name)
name
- the name of the requested attribute
NullPointerException
- if name is nullpublic Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException
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.
constructorParameter
- the value to pass to the constructor,
or null if this type of service does not use a constructorParameter.
InvalidParameterException
- if the value of
constructorParameter is invalid for this type of service.
NoSuchAlgorithmException
- if instantation failed for
any other reason.public boolean supportsParameter(Object parameter)
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.
parameter
- the parameter to test
InvalidParameterException
- if the value of parameter is
invalid for this type of service or if this method cannot be
used with this type of servicepublic String toString()