traits icon indicating copy to clipboard operation
traits copied to clipboard

Extends JWK implementation to include optional fields

Open martynp opened this issue 1 year ago • 2 comments

The intent is to provide access to the additional fields that a JWK may contain to avoid re-processing the JWK file to get at that data.

This MR will need to wait for the next release of serdect (for serde derive features) and I think elliptic-curves needs updating to make it usable? (at least the master branch emits a load of primeorder related missing trait implementations).

The main change is to add the optional fields to the JwkEcKey struct and make all fields public. I replaced the custom (de)serializer to use the derive based one, it should now be order agnostic but still enforce "EC" key types. It should also cope with any additional fields gracefully - non-standard fields would still need to be decoded separately.

I have also added in a thumbprint method which is very useful.

martynp avatar Apr 07 '24 07:04 martynp

https://github.com/RustCrypto/traits/issues/1247 https://github.com/RustCrypto/traits/issues/1016

martynp avatar Apr 07 '24 07:04 martynp

I wonder if perhaps we should try to migrate from this built-in implementation to https://github.com/RustCrypto/JOSE/tree/master/jose-jwk

tarcieri avatar Oct 15 '24 23:10 tarcieri