public static byte[] hmacSha1(byte[] input, byte[] key) {
		try {
			SecretKey secretKey = new SecretKeySpec(key, HMACSHA1_ALG);
			Mac mac = Mac.getInstance(HMACSHA1_ALG);
			mac.init(secretKey);
			return mac.doFinal(input);
		} catch (GeneralSecurityException e) {
			throw ExceptionUtil.unchecked(e);
		}
	}
public static byte [ ] hmacSha1 ( byte [ ] input , byte [ ] key ) { try { SecretKey secretKey = new SecretKeySpec ( key , HMACSHA1_ALG ) ; Mac mac = Mac . getInstance ( HMACSHA1_ALG ) ; mac . init ( secretKey ) ; return mac . doFinal ( input ) ; } catch ( GeneralSecurityException e ) { throw ExceptionUtil . unchecked ( e ) ; } }
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.

@param input 原始输入字符数组
@param key HMAC-SHA1密钥