public static byte[] hmacSHA1(byte[] data, byte[] key) {
        checkNotNull(data);
        checkNotNull(key);
        HMac hMac = new HMac(new SHA1Digest());
        KeyParameter keyParameter = new KeyParameter(key);
        hMac.init(keyParameter);
        hMac.update(data, 0, data.length);
        byte[] result = new byte[hMac.getMacSize()];
        hMac.doFinal(result, 0);
        return result;
    }
public static byte [ ] hmacSHA1 ( byte [ ] data , byte [ ] key ) { checkNotNull ( data ) ; checkNotNull ( key ) ; HMac hMac = new HMac ( new SHA1Digest ( ) ) ; KeyParameter keyParameter = new KeyParameter ( key ) ; hMac . init ( keyParameter ) ; hMac . update ( data , 0 , data . length ) ; byte [ ] result = new byte [ hMac . getMacSize ( ) ] ; hMac . doFinal ( result , 0 ) ; return result ; }
Hash-based message authentication code with SHA1 digest as defined in:
<a href="http://www.ietf.org/rfc/rfc2104.txt">RFC 2104</a>.

@param data
@param key
@return