Understanding SSL Certificate File Formats and Extensions
Michael FosterShare
SSL Certificates, Private Keys, Intermediate Certificates and SSL Certificate bundles can be stored in various file formats and use different file extensions. Understanding these formats is essential for successfully installing and managing your SSL Certificates across different server platforms. Trustico® provides this guide to help you understand the different file types, what they contain and how to work with them effectively.
The file format you need depends on your server software and how you obtained your SSL Certificate. Some servers require text-based files while others need binary formats or bundled container files. Trustico® offers online tools at tools.trustico.com 🔗 to help you convert between formats and create the files you need.
Understanding SSL Certificate File Formats
SSL Certificate files can be broadly categorized into three main types based on how the data is encoded and stored. Understanding these categories will help you identify which format you have and which format you need for your specific server environment.
Text-Based (PEM) Formats
Privacy Enhanced Mail (PEM) is the most common format for SSL Certificates. Privacy Enhanced Mail (PEM) files are Base64 encoded and can be opened in any text editor such as Notepad on Windows or TextEdit on macOS. These files contain human-readable headers and footers that identify the content type.
A Privacy Enhanced Mail (PEM) encoded SSL Certificate will begin with the line "-----BEGIN CERTIFICATE-----" and end with "-----END CERTIFICATE-----". Similarly, a Private Key in Privacy Enhanced Mail (PEM) format will begin with "-----BEGIN PRIVATE KEY-----" or "-----BEGIN RSA PRIVATE KEY-----" and end with the corresponding closing line. Learn About Base64 Encoding 🔗
The text-based nature of Privacy Enhanced Mail (PEM) files makes them versatile and easy to work with. You can copy and paste the content between systems, combine multiple SSL Certificates into a single file or extract individual components as needed.
Binary (DER) Formats
Distinguished Encoding Rules (DER) is a binary format that cannot be read in a text editor. Distinguished Encoding Rules (DER) files contain the same information as Privacy Enhanced Mail (PEM) files but in a more compact binary representation. Windows servers and Java-based applications often use Distinguished Encoding Rules (DER) encoded files.
If you open a Distinguished Encoding Rules (DER) file in a text editor, you will see garbled characters rather than readable text. These files must be converted to Privacy Enhanced Mail (PEM) format if you need to view or edit the contents. Learn About X.509 SSL Certificate Standards 🔗
Container Formats
Container formats such as Personal Information Exchange (PFX) and PKCS#12 bundle multiple components together into a single file. These containers typically include the SSL Certificate, the Private Key and any Intermediate Certificates required to complete the chain of trust.
Container formats are password-protected, providing an additional layer of security when transferring SSL Certificate files between systems. Windows Internet Information Services (IIS) and many other Microsoft products prefer the Personal Information Exchange (PFX) format for SSL Certificate installation. Learn About Personal Information Exchange (PFX) Files 🔗
Common File Extensions Explained
SSL Certificate files use various extensions to indicate their format and contents. However, file extensions are merely naming conventions and do not always accurately reflect the actual encoding of the file. Understanding what each extension typically represents will help you work with SSL Certificate files more effectively.
The .pem Extension
Files with the .pem extension are typically Base64 encoded text files in Privacy Enhanced Mail (PEM) format. These files can contain SSL Certificates, Private Keys, Intermediate Certificates or any combination of these components. Apache and Nginx web servers commonly use .pem files for SSL Certificate configuration.
You can open .pem files in any text editor to view their contents. If the file contains multiple components, each will be clearly separated by its own BEGIN and END headers.
The .crt and .cer Extensions
The .crt and .cer extensions are commonly used for SSL Certificate files and are essentially interchangeable. These files typically contain only the SSL Certificate itself without the Private Key. The encoding can be either Privacy Enhanced Mail (PEM) or Distinguished Encoding Rules (DER) format depending on how the file was created.
Windows systems often use the .cer extension while Unix and Linux systems tend to use .crt. If you receive a file with either extension and need to determine the format, try opening it in a text editor. If you can read the content and see the BEGIN CERTIFICATE header, it is Privacy Enhanced Mail (PEM) encoded. If you see garbled characters, it is Distinguished Encoding Rules (DER) encoded.
The .key Extension
Files with the .key extension contain Private Key data. The Private Key is generated alongside your Certificate Signing Request (CSR) and is essential for SSL Certificate installation. Without the matching Private Key, your SSL Certificate cannot be installed or used.
Private Key files are typically Privacy Enhanced Mail (PEM) encoded and will display "-----BEGIN PRIVATE KEY-----" or "-----BEGIN RSA PRIVATE KEY-----" when opened in a text editor. Some Private Keys may be encrypted with a passphrase for additional security. Learn About Private Key Fundamentals 🔗
The .der Extension
The .der extension indicates a file in Distinguished Encoding Rules (DER) binary format. These files cannot be opened or read in a text editor. Java keystores and some Windows applications use Distinguished Encoding Rules (DER) encoded files.
To convert a Distinguished Encoding Rules (DER) file to Privacy Enhanced Mail (PEM) format for easier handling, you can use OpenSSL or the conversion tools available at tools.trustico.com 🔗
The .pfx and .p12 Extensions
The .pfx and .p12 extensions are used for PKCS#12 container files. These are binary files that bundle the SSL Certificate, Private Key and Intermediate Certificates into a single password-protected archive. The .pfx extension is commonly used on Windows while .p12 is more common on macOS and Unix systems, but the formats are identical.
Personal Information Exchange (PFX) files are the preferred format for importing SSL Certificates into Windows Internet Information Services (IIS), Microsoft Exchange and other Windows server applications. Trustico® provides an online tool to create Personal Information Exchange (PFX) files from your SSL Certificate and Private Key components. Learn About Working with PFX Files in Windows 🔗
The .p7b and .p7c Extensions
Files with .p7b or .p7c extensions use the PKCS#7 format, which can contain one or more SSL Certificates but never includes Private Keys. This format is often used to distribute SSL Certificate chains including Intermediate Certificates. Windows and Java Tomcat servers sometimes use PKCS#7 formatted files.
If you receive your SSL Certificate in .p7b format and need to extract individual SSL Certificates, you can use OpenSSL or online conversion tools to convert to Privacy Enhanced Mail (PEM) format.
The .txt Extension
SSL Certificate data in Privacy Enhanced Mail (PEM) format can be saved with a .txt extension since it is simply text data. This is perfectly acceptable and the file will function identically to a .pem or .crt file when used with your server software. The extension does not affect the contents or functionality of the file.
Many Certificate Authorities (CA) and SSL Certificate providers deliver SSL Certificates as plain text that you copy from a web page or e-mail. You can paste this text into Notepad or any text editor and save it with whatever extension your server requires.
Understanding SSL Certificate File Contents
Different types of cryptographic data are used in SSL Certificate deployment. Understanding what each type contains and how it relates to the others will help you manage your SSL Certificate files correctly.
SSL Certificate Files
The SSL Certificate file contains your public SSL Certificate that is issued by the Certificate Authority (CA). This file includes information about your domain name, your organization if applicable, the Certificate Authority (CA) that issued it, the validity period and your Public Key. The SSL Certificate is not secret and can be shared publicly.
When you open an SSL Certificate file in a text editor, you will see Base64 encoded data between the BEGIN CERTIFICATE and END CERTIFICATE headers. This encoded data contains all the SSL Certificate information in a standardized X.509 format.
Private Key Files
The Private Key file contains your secret cryptographic key that must be kept confidential. The Private Key is generated on your server when you create your Certificate Signing Request (CSR) and should never be shared or transmitted insecurely. If your Private Key is compromised, your SSL Certificate should be revoked and reissued immediately.
Private Keys can be stored with or without passphrase protection. A passphrase-protected Private Key will show "-----BEGIN ENCRYPTED PRIVATE KEY-----" when opened in a text editor. While passphrase protection adds security, it may require you to enter the passphrase each time your server restarts. Learn About Locating Your Private Key 🔗
Intermediate Certificate Files
Intermediate Certificates form the chain of trust between your SSL Certificate and the trusted Root Certificate that browsers recognize. Most SSL Certificates require one or more Intermediate Certificates to be installed alongside the main SSL Certificate.
Intermediate Certificates are sometimes called chain files or Certificate Authority (CA) bundle files. They are public SSL Certificates and can be downloaded from the Certificate Authority (CA) or from Trustico® if you need to obtain them separately. Learn About Intermediate SSL Certificates 🔗
SSL Certificate Bundle Files
An SSL Certificate bundle combines multiple SSL Certificates into a single file. The most common type of bundle includes your SSL Certificate along with all required Intermediate Certificates in the correct order. Some bundles may also include the Root Certificate, though this is typically not necessary as browsers already have trusted Root Certificates installed.
When creating a bundle file in Privacy Enhanced Mail (PEM) format, the SSL Certificates are simply concatenated with each SSL Certificate's BEGIN and END headers preserved. The order is typically your SSL Certificate first, followed by Intermediate Certificates in order from the one that signed your SSL Certificate up to the one signed by the root. Learn About Chained SSL Certificates 🔗
Working with Text-Based SSL Certificate Files
One of the advantages of Privacy Enhanced Mail (PEM) format is that SSL Certificate data is plain text that can be easily copied, pasted and manipulated. This section explains how to create and work with text-based SSL Certificate files.
Creating Files from Copied Text
When Trustico® issues your SSL Certificate, the SSL Certificate data is typically provided as text that you can copy from your order tracking page or from an e-mail notification. To create a usable SSL Certificate file, simply copy the entire SSL Certificate text including the BEGIN and END lines and paste it into a plain text editor.
On Windows, open Notepad by searching for it in the Start menu or pressing Windows key plus R and typing notepad. On macOS, you can use TextEdit but you must first switch to plain text mode by selecting Format and then Make Plain Text from the menu. Do not use word processors like Microsoft Word as they add formatting that will corrupt the SSL Certificate data.
After pasting the SSL Certificate text, save the file with an appropriate extension such as .crt, .cer or .pem depending on what your server software expects. When saving in Notepad, change the "Save as type" dropdown to "All Files" to prevent Notepad from adding a .txt extension automatically.
Combining Multiple SSL Certificates
Many server configurations require you to combine your SSL Certificate with Intermediate Certificates into a single bundle file. To create a bundle, open a new text file and paste the SSL Certificates in the correct order with each SSL Certificate on its own lines.
Start with your SSL Certificate at the top of the file, followed by the Intermediate Certificates. Ensure there is a line break between the END line of one SSL Certificate and the BEGIN line of the next. Do not add any extra text, spaces or blank lines within the SSL Certificate data itself.
Extracting SSL Certificates from Bundle Files
If you have a bundle file and need to extract individual SSL Certificates, open the file in a text editor and locate each SSL Certificate by its BEGIN and END headers. Copy everything from BEGIN CERTIFICATE through END CERTIFICATE for each SSL Certificate you need and paste it into a new file.
Each distinct BEGIN and END pair represents a separate SSL Certificate. Your SSL Certificate is typically first in the bundle, followed by Intermediate Certificates in chain order.
Converting Between File Formats
Different servers and applications require SSL Certificates in specific formats. Converting between formats is a common task when deploying SSL Certificates across diverse infrastructure.
Using OpenSSL for Conversions
OpenSSL is a powerful command-line tool available for Windows, macOS and Linux that can convert SSL Certificate files between formats. OpenSSL is pre-installed on most Linux distributions and macOS systems. Windows users can download OpenSSL from various sources or use the version included with Git for Windows.
Common OpenSSL conversion commands include converting Privacy Enhanced Mail (PEM) to Distinguished Encoding Rules (DER), converting Distinguished Encoding Rules (DER) to Privacy Enhanced Mail (PEM) and creating Personal Information Exchange (PFX) files from separate SSL Certificate and key files. The Trustico® blog provides detailed command references and examples. Explore Our OpenSSL Quick Reference Guide 🔗
Using Trustico® Online Conversion Tools
For those who prefer not to use command-line tools, Trustico® provides free online SSL Certificate tools at tools.trustico.com 🔗 that can perform common conversions and file operations directly in your web browser.
The online tools allow you to create Personal Information Exchange (PFX) files by uploading or pasting your SSL Certificate, Private Key and Intermediate Certificates. You can also decode SSL Certificates to view their contents, verify that SSL Certificates and Private Keys match and perform other useful operations without installing any software.
Trustico® SSL Certificate Tools
Trustico® offers a comprehensive suite of free online tools to help you work with SSL Certificate files. These tools are available at tools.trustico.com 🔗 and require no software installation or registration.
Personal Information Exchange (PFX) File Generator
The Personal Information Exchange (PFX) Generator allows you to create a .pfx file from your SSL Certificate, Private Key and Intermediate Certificates. Simply paste or upload each component, set a password for the resulting file and download your ready-to-use Personal Information Exchange (PFX) file.
This tool is particularly useful when you need to import your SSL Certificate into Windows Internet Information Services (IIS), Microsoft Exchange or other Windows server applications that require the Personal Information Exchange (PFX) format. The tool processes everything locally in your browser for security, meaning your Private Key is never transmitted to any server.
SSL Certificate Decoder
The SSL Certificate Decoder allows you to paste any SSL Certificate and view its complete details in a human-readable format. The decoder displays information including the domain name, organization details, issuer information, validity dates, key size and signature algorithm.
This tool is helpful for verifying that an SSL Certificate contains the correct information before installation or for troubleshooting SSL Certificate issues.
Certificate Signing Request (CSR) Decoder
The Certificate Signing Request (CSR) Decoder displays the contents of a Certificate Signing Request (CSR) so you can verify the information before submitting it to a Certificate Authority (CA). This helps ensure your SSL Certificate will be issued with the correct domain name and organization details. Learn About Certificate Signing Requests (CSR) 🔗
SSL Certificate Key Matcher
The SSL Certificate Key Matcher verifies that an SSL Certificate and Private Key are a matching pair. This is essential when troubleshooting installation issues, as an SSL Certificate will not function if paired with an incorrect Private Key.
Paste your SSL Certificate and Private Key into the tool to confirm they were generated together. If they do not match, you will need to locate the correct Private Key or request a reissue of your SSL Certificate with a new Certificate Signing Request (CSR).
Additional Tools
The Trustico® tools suite includes additional utilities for working with SSL Certificates. These include tools for checking SSL Certificate installation on remote servers, generating Certificate Signing Requests (CSR), converting between file formats and more. All tools are free to use and designed to simplify SSL Certificate management tasks.
Best Practices for SSL Certificate File Management
Proper management of SSL Certificate files is essential for maintaining security and avoiding service disruptions. Following these best practices will help you manage your SSL Certificate files effectively.
Organizing Your SSL Certificate Files
Create a consistent folder structure for storing SSL Certificate files. Keep all files related to a specific SSL Certificate together, including the Certificate Signing Request (CSR), Private Key, SSL Certificate and any Intermediate Certificates. Use clear naming conventions that include the domain name and expiry date to make identification easy.
Document where SSL Certificate files are stored and which files are installed on each server. This documentation becomes invaluable when SSL Certificates need to be renewed or when troubleshooting issues.
Securing Your Private Keys
Private Keys must be protected with appropriate security measures. Store Private Key files in locations with restricted access permissions so that only authorized administrators can read them. Consider using passphrase protection for Private Keys, especially when they need to be transferred between systems.
Never send Private Keys via e-mail or store them in version control systems, shared drives or other locations where they might be accessed by unauthorized parties. If you suspect a Private Key has been compromised, request a reissue of your SSL Certificate immediately. Learn About Private Key Security 🔗
Backing Up SSL Certificate Files
Maintain secure backups of all SSL Certificate files including Private Keys. Store backups in a secure location separate from your production servers. Encrypted backup storage is recommended for any backups that include Private Keys.
For manually generated Certificate Signing Requests (CSR), you are responsible for maintaining backups of your associated Private Key.
Planning for Renewal and Expiry
SSL Certificates have limited validity periods and must be renewed before they expire. Maintain records of expiry dates for all SSL Certificates and set reminders to begin the renewal process well in advance. Trustico® offers SSL Certificate monitoring services that can automatically alert you when your SSL Certificates are approaching expiry. Learn About SSL Certificate Monitoring 🔗
Troubleshooting Common File Format Issues
Working with SSL Certificate files can sometimes present challenges. This section addresses common issues and their solutions.
Wrong File Format for Your Server
If your server does not accept your SSL Certificate file, you may have the wrong format. Check your server documentation to confirm which format is required. Apache and Nginx typically use Privacy Enhanced Mail (PEM) format with .crt or .pem extensions. Windows Internet Information Services (IIS) requires Personal Information Exchange (PFX) format. Java applications often use Java KeyStore (JKS) format or PKCS#12.
Use the conversion tools at tools.trustico.com 🔗 or OpenSSL commands to convert your files to the required format.
SSL Certificate and Private Key Mismatch
If you receive an error indicating that your SSL Certificate and Private Key do not match, the files were not generated together. Use the SSL Certificate Key Matcher tool to verify whether your files match. If they do not match, you will need to locate the correct Private Key file or request a reissue using a new Certificate Signing Request (CSR). Learn About SSL Certificate Reissues 🔗
Missing Intermediate Certificates
If browsers display trust warnings despite having a valid SSL Certificate installed, you may be missing Intermediate Certificates. Check your installation to ensure all required Intermediate Certificates are properly configured. You can download Intermediate Certificates from the Certificate Authority (CA) or from your Trustico® order tracking page. Learn About Intermediate Certificate Installation 🔗
Corrupted SSL Certificate Files
SSL Certificate files can become corrupted if they are edited incorrectly or if extra characters are introduced during copying and pasting. Signs of corruption include error messages during installation or the SSL Certificate failing to decode properly.
When copying SSL Certificate text, ensure you copy everything from the first dash of the BEGIN line to the last dash of the END line. Do not add extra line breaks, spaces or characters. If you suspect corruption, download a fresh copy of your SSL Certificate from your Trustico® order tracking page.
Password Issues with Personal Information Exchange (PFX) Files
Personal Information Exchange (PFX) files are password-protected and will not open or import without the correct password. If you have forgotten the password for a Personal Information Exchange (PFX) file, you cannot recover it.
However, if you still have access to the original SSL Certificate and Private Key files separately, you can create a new Personal Information Exchange (PFX) file with a new password using the Trustico® tools. Learn About PFX Password Troubleshooting 🔗
Getting Help with SSL Certificate Files
Trustico® provides comprehensive resources and tools to help you work with SSL Certificate files. If you need assistance with file formats, conversions or installation, the following resources are available.
The online tools at tools.trustico.com 🔗 provide instant help with common tasks including creating Personal Information Exchange (PFX) files, decoding SSL Certificates and verifying key pairs. These tools are free to use and process data securely in your browser.
For customers who prefer hands-off assistance, Trustico® offers a Premium Installation service where our technical team handles the entire SSL Certificate installation process on your behalf. This service includes file format conversion and configuration for your specific server environment. Learn About Premium Installation Services 🔗
The Trustico® blog contains detailed technical articles covering SSL Certificate topics including Private Keys, file formats, OpenSSL commands and server-specific installation guides. Explore Our Blog Articles 🔗