标签: java encryption
我需要执行HMACSHA256加密,请帮帮我;
sha256 = MessageDigest.getInstance("HMACSHA1"); //I get exception in this line (No algorithm found)
答案 0 :(得分:8)
Mac hmacSha256 = Mac.getInstance("hmacSHA256");
哈希和Mac-ing不是加密。
答案 1 :(得分:-3)
尝试:
sha256 = MessageDigest.getInstance("HMAC-SHA1");
Proof link