Ring: Document interoperability of Ed25519 PKCS#8 keys

Created on 11 Jun 2019  路  6Comments  路  Source: briansmith/ring

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.

good-first-bug usability

Most helpful comment

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

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

All 6 comments

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.

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.

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

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

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

Addressed in b29699ca0d78b07186d6d4f9c3a83d62faa1b242.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

briansmith picture briansmith  路  11Comments

Ianleeclark picture Ianleeclark  路  9Comments

PvdBerg1998 picture PvdBerg1998  路  10Comments

Jake-Shadle picture Jake-Shadle  路  11Comments

briansmith picture briansmith  路  4Comments