Closed BRA1L0R closed 2 years ago
So there were actually issues with using lifetimes with them before: https://github.com/Keats/jsonwebtoken/issues/120 I've moved to owning the key entirely since it's usually not something you call often - most of the time you instantiate your keys once.
So there were actually issues with using lifetimes with them before: #120 I've moved to owning the key entirely since it's usually not something you call often - most of the time you instantiate your keys once.
Ok it makes sense it would indeed incentivize reusing keys instead of creating them multiple times.
EndodingKey and DecodingKey do unecessary copies of secret keys or ders when borrowing could be an option.
This is a proposal because I can still see scenarios where a user would want a completely owned key, but if this is the case it should be documented and specified that secrets are always cloned.