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.