From c5282f92e85f535bc218116029ccfa030e0974dc Mon Sep 17 00:00:00 2001 From: Koptan Date: Mon, 19 Feb 2024 12:16:08 +0100 Subject: [PATCH] Fix: Adding correct JWS header values --- .../eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java b/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java index 264fa6f2..0e2a7cfa 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java @@ -33,6 +33,7 @@ import java.net.URI; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -116,10 +117,16 @@ private static SignedJWT createSignedES256Jwt( var algorithm = JWSAlgorithm.EdDSA; var type = JOSEObjectType.JWT; + + //https://w3c.github.io/vc-jws-2020/#json-web-signature-2020 + var crit = new HashSet(); + crit.add("b64"); + var header = new JWSHeader( - algorithm, type, null, null, null, null, null, null, null, null, issuer, true, null, + algorithm, type, null, crit, null, null, null, null, null, null, issuer, false, null, null); + var vc = new SignedJWT(header, claimsSet); vc.sign(signer);