I am trying to convert a putty generated Ed25519 private key to a JKS keystore, I tried looking into lots of documentations but I am a bit lost
First I generate my key using puttygen (It is a key I am using as an example, I am not planning on using this one)
PuTTY-User-Key-File-3: ssh-ed25519
Encryption: none
Comment: eddsa-key-20240404
Public-Lines: 2
AAAAC3NzaC1lZDI1NTE5AAAAIN3TmCpGrfLD94S1GjHtsFUNw6hsd3SRHeuj06Yj
y9F5
Private-Lines: 1
AAAAIDt5Sc7bkLdz0zduq1sOW4dgXWNvkzfKShwdR7U9H6gZ
Private-MAC: df9c28347ae0cdd41627521dc1052f7043d6ce689e2e8bebfb492493ba6382c5
Then I export it to OpenSSH format using puttygen
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtz
c2gtZWQyNTUxOQAAACDd05gqRq3yw/eEtRox7bBVDcOobHd0kR3ro9OmI8vReQAA
AKC2h1lEtodZRAAAAAtzc2gtZWQyNTUxOQAAACDd05gqRq3yw/eEtRox7bBVDcOo
bHd0kR3ro9OmI8vReQAAAEA7eUnO25C3c9M3bqtbDluHYF1jb5M3ykocHUe1PR+o
Gd3TmCpGrfLD94S1GjHtsFUNw6hsd3SRHeuj06Yjy9F5AAAAEmVkZHNhLWtleS0y
MDI0MDQwNAECAwQFBgcICQoL
-----END OPENSSH PRIVATE KEY-----
Then I am trying to use openssl to convert this to a pkcs12 store but It is not able to read the private key, so I am stuck here.
openssl req -new -x509 -key key.pem -out certfile
And the result is :
Could not find private key from key.pem
I tried with an RSA key and it works fine, but with Ed25519 I am unable to get openssl to read the openssh format or convert it to a format that openssl can read.
openssl genpkey -algorithm ed25519