Closed Eh2406 closed 1 year ago
AFAIK, none of the keys currently implement Clone
(edit: seems AsymmetricPublicKey
does). The reason is simply that there has been no need for it so far and since the types hold secret data I've just held off on adding it. We should be able to easily add it, and as you point out yourself - there's already a way to do it non-idiomatically.
Is this something you'd like to see added, @Eh2406?
I have added this as part of #81, @Eh2406. It will be part of a 0.6.5
release today (published on crates.io now).
Thank you!
Why do keys not implement clone? There are other ways to write clone for this type in the public interface like
AsymmetricSecretKey::from(key.as_bytes()).expect("roundtrip")
. So this mostly seems like syntactic salt. Thoughts?