In order to create a PKCS#7 file perform the following steps below:
Method 1: Using Windows
- Open the .crt file by double clicking on it. If the file is another format such as .pem/.cer it can be renamed to .crt as they are the same format.
- Verify that the certificate chain is correct, by choosing the Certification Path tab.
Note: There should be 2 or 3 certificates for a complete chain.
- Go to the Details tab and select Copy to File.
- The Certificate Export Wizard opens > click Next.
- Select Cryptographic Message Syntax Standard - PKCS #7 Certificates (.P7B), and select Include all certificates in the path if possible> click Next.
- Click Browse, choose a location where you want to save the certificate file and specify a file name of the certificate you want to export. Click Save > click Next.
- Click Finish.
- To verify your .p7b file, double click on the file.
- Find the Certificates folder in the tree and verify that it contains 2 or 3 certificates (Root CA, Intermediate CA and SSL certificate).
Method 2: Using OpenSSL
- Place the intermediate and certificate files on a server with OpenSSL.
- Run the following command to combine the certificate and intermediate:
openssl crl2pkcs7 -nocrl -certfile certificate.cer -certfile intermediate.cer -out certificate.p7b