tasgr86
tasgr86

Reputation: 309

Convert private key from der to pem

I have a private and public key in der format which i'm trying to convert into .pem format in order to extract the text between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----.I've already achieved that for the public key, but for the private key i get the following error.

openssl rsa -noout -text -in priv.der

but i get an error 8536 with the private key with the message unable to load certificate.Why is that? enter image description here

Upvotes: 2

Views: 14558

Answers (1)

Matt Caswell
Matt Caswell

Reputation: 9392

You need to use the -inform DER command line option:

openssl rsa -noout -text -inform DER -in private.der

Upvotes: 4

Related Questions