I'm using this command to generate private ed25519 key:
openssl genpkey -algorithm ed25519 -out private.pem
and this is the example result:
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIAYIsKL0xkTkAXDhUN6eDheqODEOGyFZ04jsgFNCFxZf
-----END PRIVATE KEY-----
So then I want to generate a public key based on this private key and I do it like this:
openssl pkey -in private.pem -out public.pem
but with this command I still get a private key that looks like this:
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIAYIsKL0xkTkAXDhUN6eDheqODEOGyFZ04jsgFNCFxZf
-----END PRIVATE KEY-----
Additionally, this private and "public" key is not 32-bytes, but 64. What's wrong with my command?
-pubout
option is missing. – Reamesopenssl genpkey -algorithm ed25519 -outform DER -out test25519.der
. The resulted file is 48 bytes. Now you can use keystore-explorer.org then click Examine Certificate, chose the cert (pem or der), no any password so just click Enter and you'll see the cert details. Click on ASN and theOCTET STRING
is HEX encoded key and it's raw bytes – Bonucci