Skip to content
  • GDPR-compliant
  • 100% hosting in Germany
  • Personal contact
  • Support included
  • Provisioning within 24 hours
SSL certificates 1 min read

How do I convert a PEM SSL certificate into a PKCS #7 / P7B certificate?

Converting a PEM (Privacy Enhanced Mail) certificate into a PKCS #7 (Public Key Cryptography Standards) or P7B certificate can be useful if you wish to install the certificate on a server or device that requires PKCS #7 or P7B. Here are the steps you need to follow to carry out this conversion:

Conversion Prerequisites

Before you begin, ensure that you have the following files:

  • Your PEM certificate (usually with the extension .pem or .crt)
  • Your private key (usually with the extension .key)
  • (Optional) The intermediate certificates or CA bundle (usually with the extension .crt or .pem)

You will also need OpenSSL, a powerful tool for managing certificates and keys. OpenSSL comes pre-installed on most Linux distributions and can also be installed on Windows and macOS.

Conversion process

Run the following command in the console or terminal to convert your PEM certificate and private key into a PKCS #7 / P7B certificate:

openssl crl2pkcs7 -nocrl -certfile certificate.crt -out certificate.p7b -certfile CACert.crt

An overview of the components of this command:

  • certificate.p7b - the name of the PKCS #7 / P7B file you wish to create.
  • certificate.crt - the name of your PEM certificate file.
  • CACert.crt - the name of your CA bundle file (optional, if available).

Note: If you do not have a CA bundle, you can omit the `-certfile CACert.crt` part of the command.

Once you have run this command, you should have a .p7b file that you can install on your server or device. Please note that PKCS #7 / P7B certificates do not contain the private key, so you must manage and install this separately.

Was this article helpful?

You might also be interested in:

Personal support

Of course, our support team is also happy to assist you personally. If you cannot find what you are looking for in our knowledge base or require personalised support, please do not hesitate to contact us. We’re here to help you and to ensure that your experience with our products and services is as smooth and enjoyable as possible.