traits icon indicating copy to clipboard operation
traits copied to clipboard

Extends JWK implementation to include optional fields

Open martynp opened this issue 10 months 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