Package com.vonage.client.auth
Class MD5Util
java.lang.Object
com.vonage.client.auth.MD5Util
public class MD5Util extends java.lang.Object
Contains utility methods that use MD5 hashing. The class uses STANDARD JVM MD5 algorithm.
-
Constructor Summary
Constructors Constructor Description MD5Util() -
Method Summary
Modifier and Type Method Description static java.lang.StringcalculateMd5(java.lang.String input)Calculates MD5 hash for string.static java.lang.StringcalculateMd5(java.lang.String input, java.lang.String encoding)Calculates MD5 hash for string.
-
Constructor Details
-
Method Details
-
calculateMd5
public static java.lang.String calculateMd5(java.lang.String input) throws java.security.NoSuchAlgorithmExceptionCalculates MD5 hash for string. assume string is UTF-8 encoded- Parameters:
input- string which is going to be encoded into MD5 format- Returns:
- MD5 representation of the input string
- Throws:
java.security.NoSuchAlgorithmException- if the MD5 algorithm is not available.
-
calculateMd5
public static java.lang.String calculateMd5(java.lang.String input, java.lang.String encoding) throws java.security.NoSuchAlgorithmException, java.io.UnsupportedEncodingExceptionCalculates MD5 hash for string.- Parameters:
input- string which is going to be encoded into MD5 formatencoding- character encoding of the string which is going to be encoded into MD5 format- Returns:
- MD5 representation of the input string
- Throws:
java.security.NoSuchAlgorithmException- if the MD5 algorithm is not available.java.io.UnsupportedEncodingException- if the specified encoding is unavailable.
-