Skip to content
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

pkcs8: impl FromPrivateKey/FromPublicKey on respective document types #9

Closed
tarcieri opened this issue Feb 23, 2021 · 1 comment
Closed

Comments

@tarcieri
Copy link
Member

This issue proposes, as a breaking change in the next release, to impl the following:

  • FromPrivateKey (and potentially ToPrivateKey) on PrivateKeyDocument
  • FromPublicKey (and potentially ToPublicKey) on PublicKeyDocument

The methods in these traits both duplicate and thunk through the methods on the respective document types, so impl'ing the traits would consolidate all of the functionality in one place.

Another additional benefit is that methods like EncryptedPrivateKeyInfo::decrypt could be made generic around a T: FromPrivateKey return type, making it possible to decrypt encrypted private keys to any type which impls FromPrivateKey.

Likewise an encrypt method could be added to ToPrivateKey.

@tarcieri tarcieri changed the title pkcs8: impl FromPrivateKey/FromPublicKey on respective document types pkcs8: impl FromPrivateKey/FromPublicKey on respective document types Jul 27, 2021
@tarcieri tarcieri transferred this issue from RustCrypto/utils Sep 14, 2021
@tarcieri
Copy link
Member Author

Fixed in #110

bkstein added a commit to bkstein/RustCrypto-formats that referenced this issue Nov 3, 2023
baloo pushed a commit that referenced this issue Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant