Skip to content

Commit d9c6d90

Browse files
committed
feat: Parse JSON.
1 parent fbb7413 commit d9c6d90

File tree

1 file changed

+9
-0
lines changed
  • src/main/java/com/danubetech/keyformats/jose

1 file changed

+9
-0
lines changed

src/main/java/com/danubetech/keyformats/jose/JWK.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package com.danubetech.keyformats.jose;
22

3+
import com.fasterxml.jackson.databind.ObjectMapper;
34
import org.apache.commons.codec.binary.Base64;
45

6+
import java.util.Map;
7+
58
public class JWK {
69
private String kid;
710
private String use;
@@ -14,6 +17,12 @@ public class JWK {
1417
public JWK() {
1518
}
1619

20+
private static final ObjectMapper objectMapper = new ObjectMapper();
21+
22+
public static JWK parse(Map<String, Object> json) {
23+
return objectMapper.convertValue(json, JWK.class);
24+
}
25+
1726
public String getKid() {
1827
return kid;
1928
}

0 commit comments

Comments
 (0)