From 8d9ca82bf8b3841623db98f03db593fbc4bbccaa Mon Sep 17 00:00:00 2001 From: dattatrayamote Date: Tue, 16 Jul 2024 15:27:09 +0530 Subject: [PATCH] commit: Fix for DDCCGW-593 AND DDCCGW-667 Signed-off-by: dattatrayamote --- .../keydistribution/service/did/DidTrustListService.java | 4 +++- .../keydistribution/service/did/entity/DidTrustListEntry.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 b94cb70..b26381c 100644 --- a/src/main/java/tng/trustnetwork/keydistribution/service/did/DidTrustListService.java +++ b/src/main/java/tng/trustnetwork/keydistribution/service/did/DidTrustListService.java @@ -305,7 +305,9 @@ private String generateTrustList(DidSpecification specification, boolean onlyRef // Add Trusted Issuer (DID References) // TODO: Add filtering for TrustedIssuers - trustedIssuerEntities.forEach(did -> trustList.getVerificationMethod().add(did.getUrl())); + if(onlyReferences){ + trustedIssuerEntities.forEach(did -> trustList.getVerificationMethod().add(did.getUrl())); + } // Sign Document JsonWebSignature2020LdSigner signer = new JsonWebSignature2020LdSigner(byteSigner); 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 fa30153..2f61890 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 @@ -118,7 +118,7 @@ public static class RsaPublicKeyJwk extends PublicKeyJwk { */ public RsaPublicKeyJwk(RSAPublicKey rsaPublicKey, List base64EncodedCertificates) { super("RSA", base64EncodedCertificates); - valueN = Base64.getUrlEncoder().encodeToString(rsaPublicKey.getModulus().toByteArray()); + valueN = Base64.getUrlEncoder().encodeToString(rsaPublicKey.getModulus().toByteArray()).split("=")[0]; valueE = Base64.getUrlEncoder().encodeToString(rsaPublicKey.getPublicExponent().toByteArray()); } }