Export P7b file with all the certificate chain into CER file

后端 未结 5 439
清歌不尽
清歌不尽 2021-01-31 08:51

I have p7b file provided by Thwate.When I am trying to export the certificate in the cer file using the below command, the certificate chain is not included.
Please suggest

5条回答
  •  离开以前
    2021-01-31 09:14

    The selected answer didn't work for me, but it's close. I found a tutorial that worked for me and the certificate I obtained from StartCom.

    1. Open the .p7b in a text editor.
    2. Change the leader and trailer so the file looks similar to this:

      -----BEGIN PKCS7-----
      [... certificate content here ...]
      -----END PKCS7-----
      

    For example, my StartCom certificate began with:

        -----BEGIN CERTIFICATE----- 
    

    and ended with:

        -----END CERTIFICATE----- 
    
    1. Save and close the .p7b.
    2. Run the following OpenSSL command (works on Ubuntu 14.04.4, as of this writing):

      openssl pkcs7 -print_certs –in pkcs7.p7b -out pem.cer
      

    The output is a .cer with the certificate chain.

    Reference: http://www.freetutorialssubmit.com/extract-certificates-from-P7B/2206

提交回复
热议问题