Skip to content
Aarrange

P7B to PEM

Drop a P7B or PKCS #7 file, binary or text, and get every certificate as PEM. Nothing leaves your browser.

Also: All formats, PFX to PEM, PEM to PFX, CRT to PEM

0
Certificates
0
Keys
0
Errors
Tab types a tab. Press Escape, then Tab, to leave the editor.
Result
The result shows here as you type.Try or .
On this page

Quick answer

Drop the .p7b file above and download Full chain. For a binary P7B, add -inform DER to the command.

With openssl
openssl pkcs7 -print_certs -in cert.p7b -out fullchain.pem

About P7B to PEM

Updated

What does a P7B to PEM converter do?

A P7B file holds your certificate and the CA chain in one PKCS #7 structure. nginx, Apache and HAProxy cannot read it: they want PEM. This page takes the certificates out, puts them in server order and gives you each file. Add your private key to make a PFX instead.

How to use this tool

  1. Drop the .p7b or .p7c file, binary or text. Or paste the block from -----BEGIN PKCS7----- to the END line.
  2. A private key can go in the same box or in the Private key tab. The tool finds which key belongs to which certificate.
  3. You can add several files. Pick them all at once in File, or drop them together. A file you add later goes below the text that is there: it does not replace it. A .key file goes to the Private key tab by itself. Clear empties the editor.
  4. Pick the format in To. For a PFX, type the password in the Password field. On a wide screen, To and Password are next to Convert. On a smaller screen, they are under Options, and on a phone under More.
  5. Copy the text, or press Download to save the file. A PFX or DER file downloads as a real binary file, ready to import.

A P7B often has the root certificate too. Servers do not need to send the root, since clients have it. The Chain view has every CA certificate; leave the last one out if your server guide says so. The CERTIFICATE blocks are in the same order as the chain.

The same tool, set up for other jobs: SSL Converter (all formats), PFX to PEM, PEM to PFX, CRT to PEM.

P7B, PEM and other certificate formats

FormatExtensionsWhat is insideUsed by
PEM.pem .crt .cer .keyBase64 text between BEGIN and END lines. Certificates, chain and key, in one file or several.nginx, Apache, HAProxy, Node.js, Linux, Let's Encrypt
DER.der .cer .crtOne certificate in binary. The same data as PEM, without the Base64.Java, Windows, Android, some routers
P7B.p7b .p7cPKCS #7: a list of certificates, often the whole chain. Never a private key.Windows, Tomcat, Java keytool, many CAs
PFX.pfx .p12PKCS #12: certificates and the private key in one binary file, locked with a password.IIS, Windows, Azure, Exchange, macOS Keychain

Common P7B to PEM errors

A P7B file has no private key

P7B holds certificates only. To make a PFX from a P7B, you also need the private key from when you made the CSR. Paste the P7B, add the key in the Private key tab, and set To to PFX. If the key is lost, ask the CA to issue the certificate again with a new CSR.

The chain is in the wrong order

A server must send its own certificate first, then each issuer up to the root. A file with the root first works on some servers and fails on some clients. The tool puts the certificates in server order and says so in Notes. To check a chain in more detail, use the Certificate Decoder.

Convert P7B to PEM with openssl

The same conversion as an openssl command. Run them where the files are, on your own computer.

P7B to PEM, and PEM to P7B
openssl pkcs7 -print_certs -in cert.p7b -out fullchain.pem
openssl crl2pkcs7 -nocrl -certfile fullchain.pem -out cert.p7b

For a binary P7B, add -inform DER to the first command. To make a PFX from a P7B, take the certificates out first, then add the key:

P7B to PFX
openssl pkcs7 -print_certs -in cert.p7b -out fullchain.pem
openssl pkcs12 -export -inkey privkey.pem -in fullchain.pem -out cert.pfx

Other certificate resources

P7B to PEM FAQ

How do I convert P7B to PEM?

Drop the .p7b file on the editor, or paste the text from -----BEGIN PKCS7----- to the END line. The Result shows Full chain, Certificate and Chain as PEM. With openssl, run openssl pkcs7 -print_certs -in cert.p7b -out fullchain.pem.

What is a P7B file?

A P7B file (PKCS #7, also .p7c) holds a list of certificates: often your certificate and the CA chain. It never holds a private key. It can be text with BEGIN PKCS7 lines, or binary. Windows and Tomcat use it, and many CAs send it.

How do I convert P7B to PFX?

Paste the P7B, then paste your private key in the Private key tab. Set To to PFX and type a password in the Password field. The key is the one you made with the CSR: a P7B never has it. The tool checks that the key fits the certificate.

How do I convert P7B to CRT or CER?

Download the Certificate view and rename the file to .crt. PEM and CRT are the same text. For a binary .cer file, set To to DER and download.

Why does my P7B file not open in other converters?

Some converters use a library that cannot read ECC certificates, or a binary P7B. They say the file is corrupt. This tool reads RSA and ECC certificates, in text or binary P7B files.

Is it safe to convert a P7B file online?

Yes. The tool converts in your browser, in JavaScript on this page. Your files, your private key and the password are never uploaded, stored or logged, and nothing goes in the URL. The password is not saved, not even in your browser. You can check this yourself. Open the developer tools (F12), go to the Network tab and convert a file: no request goes out. Or load the page, turn off Wi-Fi and convert a PFX. For a key that guards a large site, the safest place is still your own computer: the openssl commands are on this page.