Convert HTTPS certificates in different formats to PEM format - (2024)

Overview

The certificate file (*.pem) in the PEM format consists of the Base64-encoded binary content, the starting line (-----BEGIN CERTIFICATE-----), and the ending line (-----END CERTIFICATE-----). This topic describes how to convert HTTPS certificates in different formats to the PEM format.

Background information

Convert CER or CRT format certificates to PEM format

For certificates in CER or CRT format, you can directly modify the certificate file name extension to convert them into PEM format. For example, you can rename the server.crt certificate file to server.pem.

Convert certificates in the PFX format to the PEM format

Certificates in PFX format generally appear in Windows Server servers. You can use the OpenSSL tool to convert them. Run the following two OpenSSL commands to convert a PFX format certificate into a PEM format certificate:

  • Command to extract only the private key file: openssl pkcs12 -in [$Cert_Name.pfx] -nocerts -out key.pem -nodes
    Note:
    • [$Cert_Name.pfx] is the PFX format certificate to be converted.
    • key.pem is the extracted private key file.

  • Command to extract only the public key file: openssl pkcs12 -in [$Cert_Name.pfx] -nokeys -out cert.pem
    Note :cert.pem is the extracted public key file.
  • Commands to extract public and private key merge files: openssl pkcs12 -in [$Cert_Name.pfx] -nodes -out all.pem

Convert certificates in the P7B format to the PEM format

P7B certificates are generally available in Windows servers and Tomcat servers. You can use the OpenSSL tool to convert certificates. Follow these steps to convert a P7B format certificate to a PEM format certificate.

  1. Run the following command to convert the P7B format certificate file into a CER file:
    openssl pkcs7 -print_certs -in [$Incertificat.p7b] -out [$Outcertificate.cer]
    Note:
    • [$Incertificat.p7b] is the P7B format certificate to be converted.
    • [$Outcertificate.cer] is the converted PEM certificate.

  2. Only the certificate content that starts with "----- BEGIN CERTIFICATE -----" and ends with "----- END CERTIFICATE -----" in the CER file is retained as follows.
    -----BEGIN CERTIFICATE-----
    MIIE5zCCA8+gAwIBAgIQN+whYc2BgzAogau0dc3PtzANBgkqh......
    -----END CERTIFICATE-----
  3. Then change the extension of the CER file to .pem.

Convert certificates in the DER format to the PEM format

DER format certificates generally appear in the Java platform. You can use OpenSSL tools to convert them into PEM format. By executing the following two OpenSSL commands, the DER format certificate is converted to the PEM format.

  • Command to extract only the public key file: openssl x509 -inform der -in certificate.der -out certificate.pem
    Note :certificate.der is a certificate in the DER format and certificate.pem is a converted certificate in the PEM format. The specific documents are subject to the actual environment.
  • Command to extract only the private key file: openssl rsa -inform DER -outform PEM -in privatekey.der -out privatekey.pem
    Note :privatekey.der is a DER certificate. privatekey.pem is a converted PEM certificate. The specific documents are subject to the actual environment.

References

For more information about certificate formats, see What are the mainstream digital certificate formats.

Applicable scope

  • Anti-DDoS Pro and Anti-DDoS Premium
  • SSL Certificates Service
Convert HTTPS certificates in different formats to PEM format - (2024)
Top Articles
FLR airdrop update | CEX.IO Help Centre
Marriott Elite Status: What You Need to Know - NerdWallet
Jack Doherty Lpsg
Windcrest Little League Baseball
Missed Connections Inland Empire
T Mobile Rival Crossword Clue
Brendon Tyler Wharton Height
RuneScape guide: Capsarius soul farming made easy
Green Bay Press Gazette Obituary
Select The Best Reagents For The Reaction Below.
Nestle Paystub
Tiraj Bòlèt Florida Soir
Edgar And Herschel Trivia Questions
Camstreams Download
Mawal Gameroom Download
What Was D-Day Weegy
Dutchess Cleaners Boardman Ohio
Learn2Serve Tabc Answers
Keurig Refillable Pods Walmart
ZURU - XSHOT - Insanity Mad Mega Barrel - Speelgoedblaster - Met 72 pijltjes | bol
Lista trofeów | Jedi Upadły Zakon / Fallen Order - Star Wars Jedi Fallen Order - poradnik do gry | GRYOnline.pl
Pasco Telestaff
Mj Nails Derby Ct
Atlases, Cartography, Asia (Collection Dr. Dupuis), Arch…
Construction Management Jumpstart 3Rd Edition Pdf Free Download
15 Primewire Alternatives for Viewing Free Streams (2024)
Divina Rapsing
Meggen Nut
Datingscout Wantmatures
DIY Building Plans for a Picnic Table
Chadrad Swap Shop
Mkvcinemas Movies Free Download
Kattis-Solutions
Blackstone Launchpad Ucf
Kstate Qualtrics
Police Academy Butler Tech
About Us | SEIL
Omnistorm Necro Diablo 4
2008 DODGE RAM diesel for sale - Gladstone, OR - craigslist
NHL training camps open with Swayman's status with the Bruins among the many questions
Other Places to Get Your Steps - Walk Cabarrus
Ethan Cutkosky co*ck
3 bis 4 Saison-Schlafsack - hier online kaufen bei Outwell
New Starfield Deep-Dive Reveals How Shattered Space DLC Will Finally Fix The Game's Biggest Combat Flaw
All Buttons In Blox Fruits
Horseneck Beach State Reservation Water Temperature
BYU Football: Instant Observations From Blowout Win At Wyoming
Zalog Forum
Acellus Grading Scale
Stone Eater Bike Park
Latest Posts
Article information

Author: Mr. See Jast

Last Updated:

Views: 5891

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Mr. See Jast

Birthday: 1999-07-30

Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

Phone: +5023589614038

Job: Chief Executive

Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.