Can't convert #pkc1 pgp private/public key to #pkc8

46 Views Asked by At

openSSL pkcs8 -in private-key.pem -topk8 -nocrypt -out private-pkc8.pk8

I run this command and it prompts; "Could not find private key of key from private-key.pem"

I can't seem to find a solution.

  1. I looked it up and private/public key files are using UTF-8.

  2. They start like this: -----BEGIN PGP PUBLIC(PRIVATE) KEY BLOCK----- -----END PGP PUBLIC(PRIVATE) KEY BLOCK-----

I tried chaning these to various things but sadly none worked.

  1. I tried this command; sudo ssh-keygen -e -f private-key.pem -m PKCS8 > public-key.pem //private-key being #pkc1

It prompts; "Load key "private-key.pem": invalid format"

  1. I also tried this command; openssl rsa -RSAPublicKey_in -in public-key.pem -pubout

It prompts; unable to load Public Key 140704425797376:error:0908F066:PEM routines:get_header_and_data:bad end line:crypto/pem/pem_lib.c:852:

Is there anything more I can try?

0

There are 0 best solutions below