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
About Us | Flanagan State Bank
International Investment Bank (IIB) General Information
Part time Jobs in El Paso; Texas that pay $15, $25, $30, $40, $50, $60 an hour online
Pieology Nutrition Calculator Mobile
Arkansas Gazette Sudoku
Naturalization Ceremonies Can I Pick Up Citizenship Certificate Before Ceremony
Toonily The Carry
LeBron James comes out on fire, scores first 16 points for Cavaliers in Game 2 vs. Pacers
Sams Gas Price Fairview Heights Il
Thayer Rasmussen Cause Of Death
What to do if your rotary tiller won't start – Oleomac
Valentina Gonzalez Leak
How to Store Boiled Sweets
Grab this ice cream maker while it's discounted in Walmart's sale | Digital Trends
Average Salary in Philippines in 2024 - Timeular
Lehmann's Power Equipment
X-Chromosom: Aufbau und Funktion
Fort Mccoy Fire Map
Nearest Walgreens Or Cvs Near Me
Kringloopwinkel Second Sale Roosendaal - Leemstraat 4e
Ford F-350 Models Trim Levels and Packages
Valic Eremit
How to Make Ghee - How We Flourish
Craigslist Lake Charles
Pioneer Library Overdrive
Malluvilla In Malayalam Movies Download
Motorcycle Blue Book Value Honda
Generator Supercenter Heartland
Vlacs Maestro Login
Motor Mounts
Lawrence Ks Police Scanner
Rugged Gentleman Barber Shop Martinsburg Wv
3473372961
Smayperu
The Ride | Rotten Tomatoes
Spinning Gold Showtimes Near Emagine Birch Run
Cross-Border Share Swaps Made Easier Through Amendments to India’s Foreign Exchange Regulations - Transatlantic Law International
Troy Gamefarm Prices
Wattengel Funeral Home Meadow Drive
The disadvantages of patient portals
Tugboat Information
Sabrina Scharf Net Worth
Nail Salon Open On Monday Near Me
Cocaine Bear Showtimes Near Cinemark Hollywood Movies 20
Stranahan Theater Dress Code
Conan Exiles Tiger Cub Best Food
Professors Helpers Abbreviation
8 4 Study Guide And Intervention Trigonometry
Benjamin Franklin - Printer, Junto, Experiments on Electricity
Model Center Jasmin
Ubg98.Github.io Unblocked
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.