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
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
public class HMAC { | |
public static void main(String[] args) throws Exception { | |
System.out.println(hmacDigest("The quick brown fox jumps over the lazy dog", "key", "HmacSHA1")); | |
} |