1

OS: Linux openssl version: OpenSSL 1.1.1f 31 Mar 2020

I use

ssh-keygen -t ed25519 -C "your_email@example.com"

to generate my key my-key and my-key.pub.

I want to self-sign my certificate by

openssl req -new -subj "/C=GC/CN=foo" -addext "subjectAltName = DNS:x.y.z" -addext "certificatePolicies = 1.2.3.4" -key ~/.ssh/my-key -out req.pem

and it turns out error:

error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: ANY PRIVATE KEY

The start of my private key my-key is

-----BEGIN OPENSSH PRIVATE KEY-----

and I tried

openssl rsa -in my-key -outform pem > my-key.pem

to convert my private key to PEM format, and it turns out the same error.

I tried

ssh-keygen -p -N "" -m pem -f my-key

it says that this command changes file in place, but my file does not change at all.

Evian
  • 1,035
  • 1
  • 9
  • 22
  • Does this answer your question? [Openssh Private Key to RSA Private Key](https://stackoverflow.com/questions/54994641/openssh-private-key-to-rsa-private-key) – arved Jul 28 '21 at 10:10
  • @arved Unfortunately, this answer doesn't work for me, I will edit my question to add this situation. – Evian Jul 29 '21 at 07:24

0 Answers0