convert .cer format to .pem format in command line, Need help...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

convert .cer format to .pem format in command line, Need help...

buddhika-2
Hi,
I want to convert .cer format to .pem format with the private key.I tried it by using following command.
openssl x509 -inform der -in certificate.cer -out certificate.pem

But the certificate.pem file doesn't contain the private key. To do this task, I want to use command line.
Pls can any one help me...

Thanks
Buddhika
Reply | Threaded
Open this post in threaded view
|

Re: convert .cer format to .pem format in command line, Need help...

Martin Plenk
Hello,

I'm not an expert, but I think, thot you forgot to specify the outform
paramter:
openssl x509 -inform pem -in certificate.cer -outform der -out
certificate.pem

Best regards

Martin

buddhika schrieb:

> Hi,
> I want to convert *.cer* format to *.pem* format with the private key.I
> tried it by using following command.
> *openssl x509 -inform der -in certificate.cer -out certificate.pem
>
> *But the *certificate.pem* file doesn't contain the private key. To do
> this task, I want to use command line.
> Pls can any one help me...
>
> Thanks
> Buddhika

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: convert .cer format to .pem format in command line, Need help...

Bernhard Fröhlich-2
In reply to this post by buddhika-2
buddhika schrieb:
> Hi,
> I want to convert *.cer* format to *.pem* format with the private
> key.I tried it by using following command.
> *openssl x509 -inform der -in certificate.cer -out certificate.pem
>
> *But the *certificate.pem* file doesn't contain the private key. To do
> this task, I want to use command line.
> Pls can any one help me...

The *.cer extension is usually used for _certificates_. Certificates do
not contain a private key (just the public one), so it's not uncommon to
run into troubles trying to extract one from it! ;)
I guess you'll have to look for a *.p12 file (a PKCS#12 bag) and use
openssl pkcs12 (http://www.openssl.org/docs/apps/pkcs12.html) to extract
your private key from that.

Hope it helps
Ted
;)

--
PGP Public Key Information
Download complete Key from http://www.convey.de/ted/tedkey_convey.asc
Key fingerprint = 31B0 E029 BCF9 6605 DAC1  B2E1 0CC8 70F4 7AFB 8D26


smime.p7s (4K) Download Attachment