-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clone_key() method to private key types #26
Conversation
Is the theory that making people write |
Yes, that is the theory. In particular, while ring AFAICT doesn't expose any way of getting at the internals of private keys except for directly after generating one, so it is more strict. I'm hoping to strike a balance that does make it possible but that triggers enough thinking to consider whether it's the right thing to do in context. |
@@ -1,6 +1,6 @@ | |||
[package] | |||
name = "rustls-pki-types" | |||
version = "1.0.1" | |||
version = "1.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For crates that have a non-zero major version, ideally we should bump the minor version when new API is added. This is not as strict of a cultural norm in the crates ecosystem as the semver-compatibility rules, but it can help to distinguish when you can downgrade (I'm a little fuzzy on the details right now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this seems reasonable to me. If both you and the OP have needed this it's fair to assume others will too.
In my case, I didn't want access to the internals of the key, I just had a few layers of abstraction between the place where I acquired the private key and where it gets used. Those intermediate layers generated borrow check errors (because they were async fns that needed to be |
Right now it's possible to clone a
PrivateKeyDer
, but it's pretty unergonomic. I added this in a work repo:Pave this path, while still avoiding a
Clone
impl that would make it easy to leak private key material.Fixes #25.