@Test(expected = IllegalArgumentException.class) public void testSha256HMacFail() throws IOException { HmacUtils.hmacSha256((byte[]) null, STANDARD_PHRASE_BYTES); }
public static byte[] hmacSha256(final byte[] key, final byte[] valueToDigest) { try { return getHmacSha256(key).doFinal(valueToDigest); } catch (final IllegalStateException e) { throw new IllegalArgumentException(e); } }
HmacUtils { public static byte[] hmacSha256(final byte[] key, final byte[] valueToDigest) { try { return getHmacSha256(key).doFinal(valueToDigest); } catch (final IllegalStateException e) { throw new IllegalArgumentException(e); } } }
HmacUtils { public static byte[] hmacSha256(final byte[] key, final byte[] valueToDigest) { try { return getHmacSha256(key).doFinal(valueToDigest); } catch (final IllegalStateException e) { throw new IllegalArgumentException(e); } }  }
HmacUtils { public static byte[] hmacSha256(final byte[] key, final byte[] valueToDigest) { try { return getHmacSha256(key).doFinal(valueToDigest); } catch (final IllegalStateException e) { throw new IllegalArgumentException(e); } }  static Mac getHmacMd5(final byte[] key); static Mac getHmacSha1(final byte[] key); static Mac getHmacSha256(final byte[] key); static Mac getHmacSha384(final byte[] key); static Mac getHmacSha512(final byte[] key); static Mac getInitializedMac(final HmacAlgorithms algorithm, final byte[] key); static Mac getInitializedMac(final String algorithm, final byte[] key); static byte[] hmacMd5(final byte[] key, final byte[] valueToDigest); static byte[] hmacMd5(final byte[] key, final InputStream valueToDigest); static byte[] hmacMd5(final String key, final String valueToDigest); static String hmacMd5Hex(final byte[] key, final byte[] valueToDigest); static String hmacMd5Hex(final byte[] key, final InputStream valueToDigest); static String hmacMd5Hex(final String key, final String valueToDigest); static byte[] hmacSha1(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha1(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha1(final String key, final String valueToDigest); static String hmacSha1Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha1Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha1Hex(final String key, final String valueToDigest); static byte[] hmacSha256(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha256(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha256(final String key, final String valueToDigest); static String hmacSha256Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha256Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha256Hex(final String key, final String valueToDigest); static byte[] hmacSha384(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha384(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha384(final String key, final String valueToDigest); static String hmacSha384Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha384Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha384Hex(final String key, final String valueToDigest); static byte[] hmacSha512(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha512(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha512(final String key, final String valueToDigest); static String hmacSha512Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha512Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha512Hex(final String key, final String valueToDigest); static Mac updateHmac(final Mac mac, final byte[] valueToDigest); static Mac updateHmac(final Mac mac, final InputStream valueToDigest); static Mac updateHmac(final Mac mac, final String valueToDigest); }
HmacUtils { public static byte[] hmacSha256(final byte[] key, final byte[] valueToDigest) { try { return getHmacSha256(key).doFinal(valueToDigest); } catch (final IllegalStateException e) { throw new IllegalArgumentException(e); } }  static Mac getHmacMd5(final byte[] key); static Mac getHmacSha1(final byte[] key); static Mac getHmacSha256(final byte[] key); static Mac getHmacSha384(final byte[] key); static Mac getHmacSha512(final byte[] key); static Mac getInitializedMac(final HmacAlgorithms algorithm, final byte[] key); static Mac getInitializedMac(final String algorithm, final byte[] key); static byte[] hmacMd5(final byte[] key, final byte[] valueToDigest); static byte[] hmacMd5(final byte[] key, final InputStream valueToDigest); static byte[] hmacMd5(final String key, final String valueToDigest); static String hmacMd5Hex(final byte[] key, final byte[] valueToDigest); static String hmacMd5Hex(final byte[] key, final InputStream valueToDigest); static String hmacMd5Hex(final String key, final String valueToDigest); static byte[] hmacSha1(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha1(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha1(final String key, final String valueToDigest); static String hmacSha1Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha1Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha1Hex(final String key, final String valueToDigest); static byte[] hmacSha256(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha256(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha256(final String key, final String valueToDigest); static String hmacSha256Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha256Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha256Hex(final String key, final String valueToDigest); static byte[] hmacSha384(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha384(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha384(final String key, final String valueToDigest); static String hmacSha384Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha384Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha384Hex(final String key, final String valueToDigest); static byte[] hmacSha512(final byte[] key, final byte[] valueToDigest); static byte[] hmacSha512(final byte[] key, final InputStream valueToDigest); static byte[] hmacSha512(final String key, final String valueToDigest); static String hmacSha512Hex(final byte[] key, final byte[] valueToDigest); static String hmacSha512Hex(final byte[] key, final InputStream valueToDigest); static String hmacSha512Hex(final String key, final String valueToDigest); static Mac updateHmac(final Mac mac, final byte[] valueToDigest); static Mac updateHmac(final Mac mac, final InputStream valueToDigest); static Mac updateHmac(final Mac mac, final String valueToDigest);  }