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

Add an extra parser to pemfile for general keys #38

Closed
ghost opened this issue Nov 30, 2016 · 4 comments
Closed

Add an extra parser to pemfile for general keys #38

ghost opened this issue Nov 30, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 30, 2016

I just did the following for test purposes:

$ openssl version
OpenSSL 1.0.2j  26 Sep 2016
$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes

And the output cannot be read by pemfile::rsa_private_key. The workaround is to do:

openssl rsa -in key.pem -out rsa_key.pem 

But it would probably be better if it worked out of the box. Also, I'm the author of Thrussh, an SSH library. How about working together on a general PEM parsing crate?

@ctz
Copy link
Member

ctz commented Nov 30, 2016

How about working together on a general PEM parsing crate?

I'd definitely be interested in working together on a PKCS8 crate for solving this problem. There's some good ASN1-DER parsing ground work in ring -- would a dependency on that be alright for use with/in Thrussh?

@briansmith
Copy link
Contributor

FWIW, my plan for ring is that all the key deserialization will be PKCS#8. We only implemented the simpler RSA key deserialization as an incremental step.

@ghost
Copy link
Author

ghost commented Dec 1, 2016

I'd definitely be alright with anything of the kind, even if it means writing it myself.
I just wanted to make sure we do it in a consensual way, à la Rust, to avoid reimplementing the same things everywhere.

Btw, there's a new Thrussh in my pipe, using Tokio.

@ghost
Copy link
Author

ghost commented Dec 16, 2016

Alright, after looking at this in greater detail, they seem to be different formats.
Definitely, SSH keys should also be stored in PKCS#8 format, but they're not, for historical reasons.
I think Thrussh should support both, and default to PKCS#8.

@ghost ghost closed this as completed Dec 16, 2016
@ctz ctz moved this from Coming to Done in rustls TODO list May 6, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants