Need help?

Our experts have had an average response time of 11.7 minutes in August 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Convert PFX to .Crt & .Key Files

by | Sep 21, 2021

Want to convert PFX to .Crt & .Key Files? We can help you.

Here at Bobcares, we often handle requests from our customers to fix similar errors as a part of our Server Management Services.

Today, let us see how to convert the .pfx file into a .crt or .key file from the encrypted key using OpenSSL for free.

 

Convert PFX to .Crt & .Key Files

OpenSSL is a full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols.

If we have the .pfx certificate from the SSL providers/registrars like a network solution, GoDaddy, big rock, etc., then we are good to proceed with the following without any hurdles.

In order to begin, our Support Techs recommend having:

  1. An OpenSSL package in the system.
  2. Then a .pfx file for the chosen domain name
  3. Windows/Ubuntu/Linux system to utilize the OpenSSL package with crt

 

  • Extract the private key from the .pfx file

openssl pkcs12 -in [yourfilename.pfx] -nocerts -out [keyfilename-encrypted.key]

With this command, we can extract the private key from the .pfx file.

Now we need to provide the import password of the .pfx file. This is to protect the keypair created for the .pfx file.

Once we enter it, OpenSSL requests to type another password twice. This new password is to protect the .key file.

[email protected]:~/Downloads/SSL-certificate$ openssl pkcs12 -in samplefilename.pfx -nocerts -out samplefilenameencrypted.key
Enter Import Password:
Enter PEM pass phrase:
Verifying — Enter PEM pass phrase:
[email protected]:~/Downloads/SSL-certificate$
  • Extract .crt file from the .pfx certificate

openssl pkcs12 -in [yourfilename.pfx] -clcerts -nokeys -out [certificatename.crt]

After that, we press enter and give the password for the certificate, hit enter again.

Eventually, the certificate will appear in the same directory.

[email protected]:~/Downloads/SSL-certificate$ openssl pkcs12 -in samplefile.pfx -clcerts -nokeys -out samplefileencrypted.crt
Enter Import Password:
  • Extract the .key file from the encrypted private key from step 1.

openssl rsa -in [keyfilename-encrypted.key] -out [keyfilename-decrypted.key]

Here, we enter the import password from step 1.

As a result, we have a certificate(.crt) and two private keys ( encrypted and unencrypted).

[email protected]:~/Downloads/SSL-certificate$ openssl rsa -in samplefilenameencrypted.key -out samplefilenameunencrypted.key 
Enter pass phrase for samplefilenameencrypted.key: 
writing RSA key

Finally, we can use .crt and .key files to run the Node / Angular / Java application with these obtained files.

[Finding it difficult? We can help you out]

 

Conclusion

In short, we saw how our Support Techs go about converting PFX.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF