Keats / jsonwebtoken

JWT lib in rust
MIT License
1.62k stars 252 forks source link

Implement Eq + Hash on `DecodingKey` #328

Closed baloo closed 10 months ago

Keats commented 10 months ago

See https://github.com/Keats/jsonwebtoken/issues/220

baloo commented 10 months ago

I'd agree with Debug here, but Hash and Eq are useful when putting a set in an evmap (https://docs.rs/evmap/10.0.2/evmap/struct.WriteHandle.html). That was my usecase.

I can't even argue DecodingKey only holds public keys as it's also used with Hmac based schemes with shared secrets. I guess I'll need to wrap my keys and implement that in a wrapper of some kind.