Convert a .cer file to .pfx file

时间:2016-04-25 08:54:11

标签: ssl openssl pki

My ultimate objective is to sign my exe.

For this i would need a certificate. From my company's pKI i got a .cer file and .p7b (certificate chain) file.

Now to sign an exe i need a .pfx file. So i want to convert a .cer file to .pfx file

For this i donwloaded openssl distribution.

Now issuing this command openssl pkcs12 -export -in certificatename.cer -inkey privateKey.key -out certificatename.pfx -certfile cacert.cer is resulting into unable to load certificates.

Does anyone have any hints on this ?

best Regards, Saurav

1 个答案:

答案 0 :(得分:7)

因此,如果你想在获得.cer文件后签署一个exe,那么诀窍就是执行以下步骤

  1. 使用openssl命令将.cer转换为.pem
  2. 使用openssl命令将.pem转换为.pfx
  3. 使用signtool使用步骤2中生成的.pfx文件对.exe进行签名。
  4. 要转换的openssl命令,请检查此

    https://www.sslshopper.com/ssl-converter.html

    对于signtool命令,请检查此

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa388170(v=vs.85).aspx

    欢呼声,

    Saurav

相关问题