Skip to content

Commit

Permalink
fix: fix ES256K signature
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibogus authored and aleksandra-bel committed Mar 15, 2024
1 parent 97437b4 commit b33f8a6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public SignedJWT createSignedJwt(URI id, Did didIssuer, String audience, Seriali
private static SignedJWT createSignedES256KJwt(ECPrivateKey ecPrivateKey, JWTClaimsSet claimsSet, String issuer) {
try {
JWSSigner signer = new ECDSASigner(ecPrivateKey);
signer.getJCAContext().setProvider(BouncyCastleProviderSingleton.getInstance());
if (!signer.supportedJWSAlgorithms().contains(JWSAlgorithm.ES256K)) {
throw new UnsupportedAlgorithmException(String.format("Invalid signing method. Supported signing methods: %s",
signer.supportedJWSAlgorithms().stream().map(Algorithm::getName).collect(Collectors.joining(", "))));
Expand Down

0 comments on commit b33f8a6

Please sign in to comment.