Generate PKCS12 file from .cer and .pvk

Posted on 2014-01-20
Last Modified: 2014-01-20
Hi Experts,

How can I generate a pfx file from a .cer and .pvk file?

Question by:thready
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Expert Comment

ID: 39794406
You can use openssl:

# openssl pkcs12 -export -out certificate.pfx -inkey certificate.key -in certificate.crt

If you need to include the certificate chain you can add "-certfile CACert.crt"

# openssl pkcs12 -export -out certificate.pfx -inkey certificate.key -in certificate.crt -certfile CACert.crt

You will be prompted to create a password twice and then cert should be created. You can check the cert with:

#openssl pkcs12 -info -in certificate.pfx

Author Comment

ID: 39794442
My key is in the Microsoft proprietary blob format (.PVK) - not any of the formats required by OpenSSL...

Accepted Solution

amatson78 earned 400 total points
ID: 39794522
My apoligies I missed that part. I should have read better. Since you have the .pvk already that part should be good. First convert the .cer to a .spc with Cert2spc.exe (

cert2Spc.exe certificate.cer certificate.spc

Open in new window

Then once that is done use pvk2pfx ( to merge the .spc and the .pvk to a .pfx file:

pvk2pfx.exe -pvk yourkey.pvk -pi <password> -spc certificate.spc -pfx certificate.pfx -po <password>

Open in new window

See if that works for you.

Cheers, Alan
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 33

Assisted Solution

by:Dave Howe
Dave Howe earned 100 total points
ID: 39794527
you can download a conversion tool to standard PEM format here:

once it is in PEM format, you can use openssl or any other suitable tool (I prefer XCA) to convert that and the CER into the #12 format.

Author Closing Comment

ID: 39794578
Thank you!

Expert Comment

ID: 39795678
Glad that it helped and thank you for the Awesome rating :)

Cheers, Alan

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FTP security 1 31
Eset Smart Securties ARP poisoning attack 3 48
View Facebook as a particular person or group 7 48
2016 Server GPO not applying to 2016 Terminal server 5 36
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
Do you know what to look for when considering cloud computing? Should you hire someone or try to do it yourself? I'll be covering these questions and looking at the best options for you and your business.
Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question