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
On this page
Quick answer
Drop the .p7b file above and download Full chain. For a binary P7B, add -inform DER to the command.
openssl pkcs7 -print_certs -in cert.p7b -out fullchain.pemAbout 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
- Drop the .p7b or .p7c file, binary or text. Or paste the block from -----BEGIN PKCS7----- to the END line.
- A private key can go in the same box or in the Private key tab. The tool finds which key belongs to which certificate.
- 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.
- 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.
- 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
| Format | Extensions | What is inside | Used by |
|---|---|---|---|
| PEM | .pem .crt .cer .key | Base64 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 .crt | One certificate in binary. The same data as PEM, without the Base64. | Java, Windows, Android, some routers |
| P7B | .p7b .p7c | PKCS #7: a list of certificates, often the whole chain. Never a private key. | Windows, Tomcat, Java keytool, many CAs |
| PFX | .pfx .p12 | PKCS #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.
openssl pkcs7 -print_certs -in cert.p7b -out fullchain.pem
openssl crl2pkcs7 -nocrl -certfile fullchain.pem -out cert.p7bFor 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:
openssl pkcs7 -print_certs -in cert.p7b -out fullchain.pem
openssl pkcs12 -export -inkey privkey.pem -in fullchain.pem -out cert.pfxOther certificate resources
- RFC 7292: PKCS #12The PFX format: safe bags, the key bag, password-based encryption and the MAC.
- RFC 9579: PBMAC1 in PKCS #12The newer MAC for PFX files, based on PBKDF2. OpenSSL 3.4 can make it, and this tool reads it.
- RFC 2315: PKCS #7The SignedData structure that a P7B file uses to carry a list of certificates.
- RFC 7468: Textual Encodings (PEM)The BEGIN and END lines and the labels: CERTIFICATE, PRIVATE KEY, PKCS7.
- openssl pkcs12 manualThe command that makes and opens PFX files, with -legacy, -nodes, -noenc and -certpbe.
- openssl pkcs7 manualThe command that prints the certificates in a P7B file with -print_certs.
- Can't import an AES256-SHA256 PFX (Microsoft)Which Windows versions cannot import a PFX made with AES-256, and that 3DES works there.
- KB5025823: .NET and PFX rounds (Microsoft)Why .NET refuses a PFX with more than 600,000 password rounds.
- Import-PfxCertificate (Microsoft)How Windows imports a PFX into a certificate store from PowerShell.
- node-forgeThe JavaScript library this tool uses to open and seal PFX files and encrypted keys.
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..
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.