Support for JWSAlgorithm.Family.ED to JWKMatcher
Issue #323
resolved
Hi, It seems like the JWKMatcher lacks support for JWSAlgorithm.Family.ED.
Is this something that will be supported in the future?
Thanks!
Comments (4)
-
-
I would be happy to submit a PR for this trivial change, but I lack permissions to do so and there are no instructions on your Report bugs and contribute page.
If someone with permissions wants to pick this up it may be as simple as this:
} else if (JWSAlgorithm.Family.ED.contains(algorithm)) { return new JWKMatcher.Builder() .keyType(KeyType.forAlgorithm(algorithm)) .keyID(jwsHeader.getKeyID()) .keyUses(KeyUse.SIGNATURE, null) .algorithms(algorithm, null) .curves(Curve.forJWSAlgorithm(algorithm)) .build();
public void testMatchEdDSAJWSHeader() { OctetKeyPair okp = new OctetKeyPair.Builder(Curve.Ed25519, new Base64URL("x")) .algorithm(JWSAlgorithm.EdDSA) .keyID("Dave") .build(); JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.EdDSA) .keyID("Dave") .jwk(okp) .build(); assertTrue(JWKMatcher.forJWSHeader(header).matches(okp)); }
-
Thanks Ben!
-
- changed status to resolved
Check out 8.17 from Maven Central in a hour or so.
- Log in to comment
Hi!
Would you be interested in submitting a PR for matching such keys?