MessageDigest.getInstance

MessageDigest.getInstance

Class Overview | Class Members | This Package | All Packages

Syntax 1
public static MessageDigest getInstance( String algorithm ) throws NoSuchAlgorithmException
Parameters
algorithm
the name of the algorithm requested. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.
Returns
a Message Digest object implementing the specified algorithm.
Description
Generates a MessageDigest object that implements the specified digest algorithm. If the default provider package contains a MessageDigest subclass implementing the algorithm, an instance of that subclass is returned. If the algorithm is not available in the default package, other packages are searched.

Exceptions
NoSuchAlgorithmException if the algorithm is not available in the caller's environment.



Syntax 2
public static MessageDigest getInstance( String algorithm, String provider ) throws NoSuchAlgorithmException, NoSuchProviderException
Parameters
algorithm
the name of the algorithm requested. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.
provider
the name of the provider.
Returns
a Message Digest object implementing the specified algorithm.
Description
Generates a MessageDigest object implementing the specified algorithm, as supplied from the specified provider, if such an algorithm is available from the provider.

Exceptions
NoSuchAlgorithmException if the algorithm is not available in the package supplied by the requested provider.
Exceptions
NoSuchProviderException if the provider is not available in the environment.
See Also
Provider