How to Convert Your Certificates and Keys to PEM?
This article provides a way to convert an SSL certificate to PEM format. Before Conversion please confirm your current certificate formate.
Verifying the Format of the Existing Certificate
- Certificates in PEM format might include the .pem, .crt, .cer, or .key extensions. PEM is an ASCII file with Base64 encoding that has the lines “—–END CERTIFICATE—–” and “—–BEGIN CERTIFICATE—–“.
- The simplest way to determine if a certificate is PEM or DER formatted is to open it in a text editor and search for the BEGIN CERTIFICATE and END CERTIFICATE sections. If these sections are present, the certificate is in PEM format. DER formatted certificates can have a.der suffix but are typically .cer.
There are Two Approaches available to Convert your Keys and Certificates to PEM.
- Using SSL Converter Tool
- Using Open SSL
Method 1: Using SSL Converter Tool
The SSL Certificate Converter tool will help to convert SSL certificates between several formats, including pem, der, p7b, and pfx. SSL certificates must be transformed into multiple formats for various platforms and devices.
An Apache server utilizes individual PEM (.crt,.cer) files, whereas a Windows server exports and imports— .pfx files. Choose your certificate file and its present type, choose the format you’d like it to be converted to, and click Convert Certificate to begin using it. (To quickly convert your SSL certificate to other formats, find Certera’s Free SSL Certificate Converter Tool!
Method 2: Using Open SSL
You can convert the certificates into the proper format using third-party software like OpenSSL if your server or device needs a certificate format different from Base64 encoded X.509.
A few typical conversion commands are listed below:
Note: For certificates, the PEM format is the most widely used. Cer, Crt, and Pem are the extensions used for PEM certificates. ASCII files that have been Base64 encoded. The binary version of the certificate is stored in the DER format. Statements beginning with “BEGIN CERTIFICATE/END CERTIFICATE” are absent from certificates in DER format. The most common extension for DER encoded certificates is ‘.der.’
OpenSSL:: CRT to PEM Conversion:
Enter the code below into the OpenSSL client:
openssl x509 -in cert.crt -out cert.pem
OpenSSL: PEM to CER Conversion
openssl x509 -in cert.cer -out cert.pem
OpenSSL: DER to PEM Conversion
openssl x509 -in cert.der -out cert.pem
Converting PEM files to these formats is likewise possible using comparable instructions. The simple, bare OpenSSL commands above are only a sample of the other arguments you can include in your command, including -inform and -outform.
Follow the Steps if you are Using Windows
- Install Certificate could be chosen by right-clicking the certificate.
- Click Next after selecting Current User.
- Choose to store all certificates in the subsequent store.
- After selecting Personal and Browse, click OK.
- Select Next.
- Select “Finish.”
- Click Start and run certmgr.msc (to open the prompt, press Windows key + R).
- Click on Personal and then select Certificates.
- Choose the certificate that you recently imported.
- Select All Tasks \u2192 Export with a right-click.
- Click Next after selecting X.509 (.cer) encoded in Base-64.
- Choose a location and give the file a name by clicking Browse.
- Select “Finish.”
- Find the file you recently exported, then rename it from.cer to.pem.