Skip to content

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

@tarcieri

Description

@tarcieri

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions