opensslprivate-keypemderformat-conversion

Unable to load Private key when convert dsa certificate from DER format to PEM format using openssl


I want to check a DER format dsa certificate is valid or not, so I try to convert it to PEM format using openssl.

openssl dsa -in 512b-dsa-example-cert.der -inform der -outform -pem -out 512b-dsa-example-cert.pem

Both files can be download from here, part 1.2.

The above command can work with rsa. But when I came to dsa, it say:

Unable to load private key

How can I pass the "Private key" to it?


Solution

  • If you want just to convert it from DER to PEM format then you can convert it as a x509 certificate:

    openssl x509 -in 512b-dsa-example-cert.der -inform DER -outform PEM -out 512b-dsa-example-cert.pem