DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How I Fixed a Silent Production Bug in Apache Airflow That Affected Thousands of Deployments
  • Accelerating Your Software Engineering Career With Open Source and Jakarta EE
  • Deterministic AI With OpenSymbolicAI
  • Automating Behavioral Evaluations for LLMs: A Practical Guide to Bloom

Trending

  • AI Agents in Java: Architecting Intelligent Health Data Systems
  • Understanding MCP Architecture: LLM + API vs Model Context Protocol
  • Invisible Failures in S/4HANA Conversions (And Why Teams Miss Them)
  • What Is Plagiarism? How to Avoid It and Cite Sources
  1. DZone
  2. Popular
  3. Open Source
  4. Converting Certificate from pfx to cer Format on Windows 10

Converting Certificate from pfx to cer Format on Windows 10

In this article, we take a look at how to transform a certificate from pfx to cer with Windows 10 with a specific executable.

By 
Ajay Sodhi user avatar
Ajay Sodhi
·
Jul. 01, 20 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
52.5K Views

Join the DZone community and get the full member experience.

Join For Free

Problem to Be Solved and Possible Ways to Solve It

There was a very beautiful and simple-looking problem. And that was to convert a certificate from PFX format to CER format. This is not something I was facing for the first time, many people may already face that challenge to solve it, and I believe they must have already solved it some way. The solution seems that it would be easy and available options to solve it would be like:

  1. There would be some free tools available online, which can convert these certificates.
  2.  There would be some online utilities that can reduce your burden and convert the certificates for you. (But they may keep your certificate with them, so BE CAREFUL.)
  3. There may be some open source project containing all the code and you need to set up that and you are ready to rock.

My dear friends, I Googled every possible solution that came into my mind, but nothing worked. Actually, there is an open-source project to do that and you can read about it from https://www.openssl.org/source/. But if you further explore it, you would find that:

  • It is mainly designed for UNIX, LINUX, but supports Windows 10 as well.
  • You can download the project from the git repo.
  • Set up it on your system, with lots of dependencies. (That may consume your full day.)
  • Run the utility.
  • Convert the certificates.

Easy Solution for Windows 10

  • Download the executable from https://slproweb.com/products/Win32OpenSSL.html

    Windows 10 executable
  • As I was using 64 bit Windows 10, so I downloaded Win64 OpenSSL v1.1.1g MSI.
  • Run the installer.
  • When asked, just choose a different location than your system files. I installed it in D drive.
  • It will again ask if you want to install the binaries into System folder or in the bin directory, choose bin directory as an option.
  • Once the installation is done, go to the location in your explorer where you have installed the utility and open the bin folder, as shown below.
  • There would be a file, named openssl.exe, right-click on it and run it as an Administrator.

    Run as administrator
  • Now you will see a command prompt kind of window.
  • Run the version command on it to check the version number and to confirm that the utility is working fine

    Run version command
  • Now run the following command to convert the certificate.
  • NOTE:  In the below command, the name given in -in parameter ap_keystore_test.pfx is my input certificate name and the name given in -out parameter ap_keystore_test.cer is my desired output certificate name.

  • Shell
     




    xxxxxxxxxx
    1


     
    1
    OpenSSL> pkcs12 -in D:\ap_keystore_test.pfx -out D:ap_keystore_test.cer -nodes
    2
    Enter Import Password:


  • It will ask you to enter the password for your certificate. Enter the password which is set to open your pfx certificate.
  • Once done, you will not see any error and you will see the command prompt again. 
  • This means, your certificate has been successfully converted into cer format.
  • You can open the cer file in any of your text editors like Notepad++ and can see the certificates in that.

Congratulations, you did it!

If this article is of some help to you, do like it. If you have any suggestions or comments, do message me, I will try to respond back ASAP.

Open source

Opinions expressed by DZone contributors are their own.

Related

  • How I Fixed a Silent Production Bug in Apache Airflow That Affected Thousands of Deployments
  • Accelerating Your Software Engineering Career With Open Source and Jakarta EE
  • Deterministic AI With OpenSymbolicAI
  • Automating Behavioral Evaluations for LLMs: A Practical Guide to Bloom

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook