Skip to content

Commit

Permalink
Fix: Adding correct JWS header values
Browse files Browse the repository at this point in the history
  • Loading branch information
koptan committed Feb 19, 2024
1 parent 8066e63 commit 9936825
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String>();
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);
Expand Down

0 comments on commit 9936825

Please sign in to comment.