diff --git a/src/main/java/eu/europa/ec/dgc/gateway/restapi/dto/did/DidTrustListEntryDto.java b/src/main/java/eu/europa/ec/dgc/gateway/restapi/dto/did/DidTrustListEntryDto.java index 567aca31..25deb323 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/restapi/dto/did/DidTrustListEntryDto.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/restapi/dto/did/DidTrustListEntryDto.java @@ -72,6 +72,13 @@ public static class EcPublicKeyJwk extends PublicKeyJwk { @JsonProperty("y") private String valueY; + /** + * Instantiate EC PublicKey JWK Class. + * + * @param ecPublicKey EC Public Key that should be wrapped. + * @param base64EncodedCertificates List of Base64 encoded Certificates assigned to provided Public Key. + * They will be added within x5c property of JWK. + */ public EcPublicKeyJwk(ECPublicKey ecPublicKey, List base64EncodedCertificates) { super("EC", base64EncodedCertificates); valueX = Base64.getEncoder().encodeToString(ecPublicKey.getW().getAffineX().toByteArray()); @@ -97,6 +104,13 @@ public static class RsaPublicKeyJwk extends PublicKeyJwk { @JsonProperty("n") private String valueN; + /** + * Instantiate RSA PublicKey JWK Class. + * + * @param rsaPublicKey RSA Public Key that should be wrapped. + * @param base64EncodedCertificates List of Base64 encoded Certificates assigned to provided Public Key. + * They will be added within x5c property of JWK. + */ public RsaPublicKeyJwk(RSAPublicKey rsaPublicKey, List base64EncodedCertificates) { super("RSA", base64EncodedCertificates); valueN = Base64.getEncoder().encodeToString(rsaPublicKey.getModulus().toByteArray()); diff --git a/src/main/java/eu/europa/ec/dgc/gateway/service/did/DidTrustListService.java b/src/main/java/eu/europa/ec/dgc/gateway/service/did/DidTrustListService.java index fa7dbce2..f3cb1a4f 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/service/did/DidTrustListService.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/service/did/DidTrustListService.java @@ -178,6 +178,7 @@ private String generateTrustList() throws Exception { return jsonLdObject.toJson(); } + private void addTrustListEntry(DidTrustListDto trustList, TrustedCertificateTrustList cert, DidTrustListEntryDto.PublicKeyJwk publicKeyJwk) throws CertificateEncodingException {