@Test public void testSignFailsForEncUse() { Jwk jwk = customKeys.forKeyId("1").get(); try { jwk.sign("someBytes".getBytes()); fail("Signing should have failed as key is for encryption only"); } catch (JwtException e) { assertThat(e.getMessage(), endsWith("does not support signing of requests")); } }
public Optional<Jwk> forKeyId(String keyId) { return Optional.ofNullable(keyMap.get(keyId)); }
JwkKeys { public Optional<Jwk> forKeyId(String keyId) { return Optional.ofNullable(keyMap.get(keyId)); } }
JwkKeys { public Optional<Jwk> forKeyId(String keyId) { return Optional.ofNullable(keyMap.get(keyId)); } private  JwkKeys(Builder builder); }
JwkKeys { public Optional<Jwk> forKeyId(String keyId) { return Optional.ofNullable(keyMap.get(keyId)); } private  JwkKeys(Builder builder); static Builder builder(); static JwkKeys create(JsonObject json); Optional<Jwk> forKeyId(String keyId); List<Jwk> keys(); }
JwkKeys { public Optional<Jwk> forKeyId(String keyId) { return Optional.ofNullable(keyMap.get(keyId)); } private  JwkKeys(Builder builder); static Builder builder(); static JwkKeys create(JsonObject json); Optional<Jwk> forKeyId(String keyId); List<Jwk> keys();  }