jsonwebtoken
jsonwebtoken copied to clipboard
Add `ES256K` algorithm
Are you planning to add more ECDSA algorithms such as ES256K (curve secp256k1)? I looked into ring which currently only seems to support ES256 and ES384. Seems like RustCrypto/elliptic-curves would support it, but I reckon that you would not consider adding the additional k256 crate at this point.
Not for now, there are a few PRs to change the backend already:
- https://github.com/Keats/jsonwebtoken/pull/377
- https://github.com/Keats/jsonwebtoken/pull/318
@Keats is there any updates on this? looks like both PRs mentioned above are either merged or closed?
I'd love to get this implemented as it makes using the jwt-cli to debug the Bluesky / AT Protocol access tokens possible. (they use ES256K)
Actually, I think I might even be able to do a PR to implement this, using the RustCrypto implementation of k265
The majority of the code looks like it'd actually be in the tests.
It should be fine to add yes
Okay, well, I tried but I'm probably too inexperienced to get this right: https://github.com/Keats/jsonwebtoken/compare/master...ThisIsMissEm:jsonwebtoken-rs:feat/implement-secp256k1-ES256K?expand=1
There's currently an error in the test to do with the private key being in an invalid format, this was a key that was exported from Node.js via the @atproto/crypto package, and the public key is the public key exported as jwk.
Maybe it's a starting point for someone else though?