Package com.doku.java.library.service.va
Class HashTool
java.lang.Object
com.doku.java.library.service.va.HashTool
The type Hash tool.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringhmacSHA256(String component, String secret)Hmac sha 256 string.static Stringsha256Base64(String myBodyJson)Sha 256 base 64 string.
-
Constructor Details
-
HashTool
public HashTool()
-
-
Method Details
-
sha256Base64
Sha 256 base 64 string.- Parameters:
myBodyJson- the my body json- Returns:
- the string
- Throws:
NoSuchAlgorithmException- the no such algorithm exception
-
hmacSHA256
public static String hmacSHA256(String component, String secret) throws InvalidKeyException, NoSuchAlgorithmExceptionHmac sha 256 string.- Parameters:
component- the componentsecret- the secret- Returns:
- the string
- Throws:
InvalidKeyException- the invalid key exceptionNoSuchAlgorithmException- the no such algorithm exception
-