@Test public void shouldSupportHmacSha256() throws Exception { assertThat(new HmacKey("", "").getAlgorithms(), hasItem(Algorithm.HMAC_SHA256)); }
public Set<Algorithm> getAlgorithms() { Set<Algorithm> algorithms = new HashSet<Algorithm>(); algorithms.add(Algorithm.HMAC_SHA512); algorithms.add(Algorithm.HMAC_SHA256); return algorithms; }
HmacKey implements Key { public Set<Algorithm> getAlgorithms() { Set<Algorithm> algorithms = new HashSet<Algorithm>(); algorithms.add(Algorithm.HMAC_SHA512); algorithms.add(Algorithm.HMAC_SHA256); return algorithms; } }
HmacKey implements Key { public Set<Algorithm> getAlgorithms() { Set<Algorithm> algorithms = new HashSet<Algorithm>(); algorithms.add(Algorithm.HMAC_SHA512); algorithms.add(Algorithm.HMAC_SHA256); return algorithms; } HmacKey(String keyId, String secret); }
HmacKey implements Key { public Set<Algorithm> getAlgorithms() { Set<Algorithm> algorithms = new HashSet<Algorithm>(); algorithms.add(Algorithm.HMAC_SHA512); algorithms.add(Algorithm.HMAC_SHA256); return algorithms; } HmacKey(String keyId, String secret); String getId(); Set<Algorithm> getAlgorithms(); boolean canVerify(); boolean verify(Algorithm algorithm, byte[] contentBytes, byte[] signatureBytes); boolean canSign(); byte[] sign(Algorithm algorithm, byte[] contentBytes); }
HmacKey implements Key { public Set<Algorithm> getAlgorithms() { Set<Algorithm> algorithms = new HashSet<Algorithm>(); algorithms.add(Algorithm.HMAC_SHA512); algorithms.add(Algorithm.HMAC_SHA256); return algorithms; } HmacKey(String keyId, String secret); String getId(); Set<Algorithm> getAlgorithms(); boolean canVerify(); boolean verify(Algorithm algorithm, byte[] contentBytes, byte[] signatureBytes); boolean canSign(); byte[] sign(Algorithm algorithm, byte[] contentBytes);  }