Package com.vonage.client.auth.hashutils
Class HmacSha256Hasher
java.lang.Object
com.vonage.client.auth.hashutils.AbstractHasher
com.vonage.client.auth.hashutils.HmacSha256Hasher
Deprecated.
This class will be made package-private in the next major release.
Contains utility methods that use HMAC SHA-256 hashing. The class uses STANDARD JVM crypto Hmac SHA-256 algorithm.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.vonage.client.auth.hashutils.AbstractHasher
buildHexString, calculate
-
Constructor Details
-
HmacSha256Hasher
public HmacSha256Hasher()Deprecated.
-
-
Method Details
-
calculate
public String calculate(String input, String secretKey, String encoding) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException Deprecated.Calculates HMAC SHA-256 hash for string.- Overrides:
calculatein classAbstractHasher- Parameters:
input- string which is going to be encoded into HMAC SHA-256 formatsecretKey- The key used for initialization of the algorithmencoding- character encoding of the string which is going to be encoded into HMAC SHA-256 format- Returns:
- HMAC SHA-256 representation of the input string
- Throws:
NoSuchAlgorithmException- if the HMAC SHA-256 algorithm is not available.UnsupportedEncodingException- if the specified encoding is unavailable.InvalidKeyException- Only applicable to HMAC encoding types, when a bad key is provided.
-
calculate
public String calculate(String input, String encoding) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException Deprecated.Calculates HMAC SHA-256 hash for string. Secret key that is supplied here is the input itself.- Specified by:
calculatein classAbstractHasher- Parameters:
input- string which is going to be encoded into HMAC SHA-256 formatencoding- character encoding of the string which is going to be encoded into HMAC SHA-256 format- Returns:
- HMAC SHA-256 representation of the input string
- Throws:
NoSuchAlgorithmException- if the HMAC SHA-256 algorithm is not available.UnsupportedEncodingException- if the specified encoding is unavailable.InvalidKeyException- if key is invalid
-