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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Member Spotlight: Shai Almong
  • AI-Era Cybersecurity, Part 1: Mapping Glasswing, Daybreak, Lightwell and the Tools Racing to Find and Fix Bugs
  • Member Spotlight: Mayowa Fajobi
  • How Open Source Builds the Soft Skills Technical Leaders Need

Trending

  • The Permission Was Valid. The Action Was Not Authorized.
  • Why Kotlin or Java Is the Wrong Question For Enterprises
  • The Window Closes: Why I Switched to Kotlin Before the Codebase Got Too Big
  • Batching Strategies: Throughput vs Latency in Practice

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Jul. 01, 20 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
53.5K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

  • Member Spotlight: Shai Almong
  • AI-Era Cybersecurity, Part 1: Mapping Glasswing, Daybreak, Lightwell and the Tools Racing to Find and Fix Bugs
  • Member Spotlight: Mayowa Fajobi
  • How Open Source Builds the Soft Skills Technical Leaders Need

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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