Introduce API to parse PEM keys in a simpler way#1305
Open
DoumanAsh wants to merge 1 commit intoRustCrypto:masterfrom
Open
Introduce API to parse PEM keys in a simpler way#1305DoumanAsh wants to merge 1 commit intoRustCrypto:masterfrom
DoumanAsh wants to merge 1 commit intoRustCrypto:masterfrom
Conversation
Member
|
This should probably go in |
Author
|
Created PR I see that it prefers to hide error meaning, but for now I think this case would benefit from having proper error to indicate what exactly is wrong, but let me know if I need to hide error anyway |
tarcieri
added a commit
to RustCrypto/traits
that referenced
this pull request
Apr 16, 2026
As suggested in RustCrypto/signatures#1305 created API to decode SecretKey from variety of PEM encodings --------- Co-authored-by: Tony Arcieri <bascule@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As per idea from RustCrypto/elliptic-curves#1733 (comment)
There is too many micro dependencies between each other but...
I cooked up
SigningKey::from_pemmethod that parses PEM content depending on label as simple as possibleAt the end of the day it requires
pem,derand optionallypkcs8withallocI initially thought
sec1lives on its own, but right now it seems to be Interleaved withpkcs8so I could make it required feature instead since there is not much benefit in having code path for builds that don't havepkcs8withalloc