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

Tracking issue for generic (e.g. key) types and owned/ref aliases #1117

Open
8 of 16 tasks
tarcieri opened this issue Jun 25, 2023 · 5 comments
Open
8 of 16 tasks

Tracking issue for generic (e.g. key) types and owned/ref aliases #1117

tarcieri opened this issue Jun 25, 2023 · 5 comments

Comments

@tarcieri
Copy link
Member

tarcieri commented Jun 25, 2023

In the latest release of spki it was changed to have generic AlgorithmIdentifier and SubjectPublicKeyInfo, along with *Owned and *Ref type aliases. This allows either zero-copy decoding with a lifetime, or decoding to an owned type with no lifetime (which enables e.g. on-the-fly 1-pass PEM decoding, since you can't borrow bytes from a PEM input).

However, other crates in this repo didn't receive a similar treatment. This is a tracking issue for those.

@baloo
Copy link
Member

baloo commented Aug 4, 2023

pkcs8::EncryptedPrivateKeyInfo will require:

  • pkcs5
    • pbes2::kdf::Kdf
    • pbes2::EncryptionScheme
    • pbes2::Parameters
    • EncryptionScheme

@tarcieri
Copy link
Member Author

tarcieri commented Aug 4, 2023

Ugh, splitting up pkcs5 sounds rather painful. The others are relatively straightforward but that one sounds like it will involve a lot of duplication.

Perhaps we can save EncryptedPrivateKeyInfo for the end, or possibly even make it just an implementation detail and remove it from the public API entirely. There are already helper methods that handle decryption/encryption.

@carl-wallace
Copy link
Contributor

At present, EncryptedPrivateKeyInfo is duplicated in #1165.

@tarcieri
Copy link
Member Author

tarcieri commented Aug 4, 2023

Okay, I guess we should find a solution.

Perhaps we can find a way to remove the lifetime that will still work on heapless targets.

@baloo
Copy link
Member

baloo commented Aug 7, 2023

I don't think there is too much duplication though. Pretty sure I can make it work without too much drama. I'll take a shot at it later today.

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

3 participants