-
-
Save anonymous/23f2597b19da01f36297 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String generateHMAC(String data) throws Exception { | |
HMAC = Mac.getInstance("HmacSHA512"); | |
SecretKeySpec secret = new SecretKeySpec(privKey.getBytes(),"HmacSHA512"); | |
HMAC.init(secret); | |
byte[] hmac_data = HMAC.doFinal(data.getBytes("UTF-8")); | |
System.out.println(Base64.getEncoder().encodeToString(hmac_data)); | |
return Base64.getEncoder().encodeToString(hmac_data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment