(String jceName, byte[] data, byte[] key)
| 138 | } |
| 139 | |
| 140 | private static byte[] hmac(String jceName, byte[] data, byte[] key) { |
| 141 | try { |
| 142 | Mac mac = Mac.getInstance(jceName); |
| 143 | mac.init(new SecretKeySpec(key, jceName)); |
| 144 | return mac.doFinal(data); |
| 145 | } catch (GeneralSecurityException e) { |
| 146 | throw new RuntimeException(e); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | public static String hmac(Object request2, Object secret2, Object algorithm2, String digest) { |
| 151 | return Hmac(request2, secret2, algorithm2, digest); |