diff --git a/src/main/java/tng/trustnetwork/keydistribution/service/did/DidTrustListService.java b/src/main/java/tng/trustnetwork/keydistribution/service/did/DidTrustListService.java index db2fcd5..4b192b6 100644 --- a/src/main/java/tng/trustnetwork/keydistribution/service/did/DidTrustListService.java +++ b/src/main/java/tng/trustnetwork/keydistribution/service/did/DidTrustListService.java @@ -360,6 +360,7 @@ private void addTrustListEntry(DidTrustList trustList, trustListEntry.setType("JsonWebKey2020"); trustListEntry.setId(specification.getEntryId( URLEncoder.encode(signerInformationEntity.getKid(), StandardCharsets.UTF_8))); + trustListEntry.setKid(URLEncoder.encode(signerInformationEntity.getKid(), StandardCharsets.UTF_8)); trustListEntry.setController(specification.getDocumentId(false)); trustListEntry.setPublicKeyJwk(publicKeyJwk); diff --git a/src/main/java/tng/trustnetwork/keydistribution/service/did/entity/DidTrustListEntry.java b/src/main/java/tng/trustnetwork/keydistribution/service/did/entity/DidTrustListEntry.java index d83b882..75c3c8d 100644 --- a/src/main/java/tng/trustnetwork/keydistribution/service/did/entity/DidTrustListEntry.java +++ b/src/main/java/tng/trustnetwork/keydistribution/service/did/entity/DidTrustListEntry.java @@ -37,6 +37,8 @@ public class DidTrustListEntry { private String id; + private String kid; + private String type; private String controller; diff --git a/src/test/java/tng/trustnetwork/keydistribution/service/DidTrustListServiceTest.java b/src/test/java/tng/trustnetwork/keydistribution/service/DidTrustListServiceTest.java index 2c332c2..f327257 100644 --- a/src/test/java/tng/trustnetwork/keydistribution/service/DidTrustListServiceTest.java +++ b/src/test/java/tng/trustnetwork/keydistribution/service/DidTrustListServiceTest.java @@ -511,6 +511,7 @@ private void assertVerificationMethod(Object in, String kid, X509Certificate dsc Assertions.assertEquals(parentDidId, jsonNode.get("controller")); Assertions.assertEquals(parentDidId + "#" + URLEncoder.encode(kid, StandardCharsets.UTF_8), jsonNode.get("id")); + Assertions.assertEquals(URLEncoder.encode(kid, StandardCharsets.UTF_8), jsonNode.get("kid")); LinkedHashMap publicKeyJwk = (LinkedHashMap) jsonNode.get("publicKeyJwk");