@Test(expected = InvalidClientMetadataException.class) public void test_WrongECCurve() { ObjectNode ecKey = Json.mapper.createObjectNode() .put("kty","EC") .put("kid","ecKid") .put("use","enc") .put("crv","wrong") .put("x","vBT2JhFHd62Jcf4yyBzSV9NuDBNBssR1zlmnHelgZcs") .put("y","up8E8b3TjeKS2v2GCH23UJP0bak0La77lkQ7_n4djqE"); ArrayNode arrayNode = Json.mapper.createArrayNode().add(ecKey); ObjectNode root = (ObjectNode) Json.mapper.createObjectNode().set("keys",arrayNode); new JWKSetDeserializer().convert(root); }
@Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); } }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }  }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }  @Override Optional<JWKSet> convert(ObjectNode node); Optional<JWKSet> convert(String jwkSetAsString); }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }  @Override Optional<JWKSet> convert(ObjectNode node); Optional<JWKSet> convert(String jwkSetAsString); final static String PARSE_ERROR_MESSAGE; }