Here you can find the source of hmacSha1(byte[] value, byte[] key)
private static byte[] hmacSha1(byte[] value, byte[] key)
//package com.java2s; //License from project: LGPL import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; public class Main { private static byte[] hmacSha1(byte[] value, byte[] key) { try {//from w w w . j av a 2 s . c om SecretKeySpec signingKey = new SecretKeySpec(key, "HmacSHA1"); Mac mac = Mac.getInstance("HmacSHA1"); mac.init(signingKey); return mac.doFinal(value); } catch (Exception e) { throw new RuntimeException(e); } } }