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

Document interoperability of Ed25519 PKCS#8 keys #833

Closed
est31 opened this issue Jun 11, 2019 · 6 comments
Closed

Document interoperability of Ed25519 PKCS#8 keys #833

est31 opened this issue Jun 11, 2019 · 6 comments

Comments

@est31
Copy link

est31 commented Jun 11, 2019

I wonder how I can use openssl to output PEM or DER formatted keys that Ed25519KeyPair::from_pkcs8 can read as input. I've tried openssl genpkey -algorithm ED25519 but that gives me a WrongAlgorithm error. The RSA key documentation has an openssl command listed, but none is listed for ed25519.

@briansmith
Copy link
Owner

Ed25519KeyPair::from_pkcs8_maybe_unchecked should be able to read OpenSSL-generated keys (PKCS#8 v1).

Ed25519KeyPair::from_pkcs8 can read the PKCS#8 v2 keys generated by Ed25519KeyPair::generate_pkcs8.

@briansmith
Copy link
Owner

To clarify further, Ed25519KeyPair::from_pkcs8_maybe_unchecked can read both v1 and v2 keys. Ed25519KeyPair::from_pkcs8 can only read v2 keys because only v2 keys have the public key for the consistency check.

@est31
Copy link
Author

est31 commented Jun 11, 2019

@briansmith yes, that's what the docs say. It would be helpful though to state that openssl genpkey -algorithm ED25519 generates v1 keys.

@briansmith briansmith changed the title How to generate ed25519 PKCS#2 key pairs Document interoperability of Ed25519 PKCS#8 keys Jun 11, 2019
@briansmith briansmith reopened this Jun 11, 2019
@briansmith
Copy link
Owner

briansmith commented Jun 11, 2019

One can use kt to generate PKCS#8 v2 keys:

cargo install kt
kt generate ed25519 --out ed25519.k8

@briansmith
Copy link
Owner

Addressed in b29699c.

@cytrinox
Copy link

cytrinox commented Dec 6, 2019

@briansmith Where can I find the kt repository? Was the code migrated to another project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants