Certificate issue: KEY or PFX from P7B and CRT

穿精又带淫゛_ 提交于 2019-12-04 16:02:14

问题


I'm new to the certificates, and this is a first time I bought it.

I generated CSR file (in IIS) and bought certificate using GoDaddy web site. They sent me two files: P7B and CRT. Since I will use the certificate for Azure Web role, I need PFX. How can I create it using only CSR, P7B, and CRT?


回答1:


Finally I managed to do that. In IIS I selected Complete Certificate Request, installed the CRT certificate, and then used Export option to save it as PFX.




回答2:


Since I will use the certificate for Azure Web role, I need PFX

Although my target server is Nancy, I'm posting the answer because it's relevant to the process of generating a PFX cert.

A Nancy-based project required a trusted cert. I found procedures to setup a self-signed using a PFX cert, Enabling SSL for Self Hosted Nancy, but it wasn't obvious how to proceed with GoDaddy certs. Digging around, I found an answer at a commercial SSL site.

So I created the CSR using OpenSSL, ordered and fetched my cert package from GoDaddy, and then managed to generate a PFX also using OpenSSL as described below.

As a side note for Nancy, I installed the PFX locally using the following

c:> certutil -importPFX certname.pfx

described here @ https://stackoverflow.com/a/33351095/241296

Maybe it's possible to completely bypass local IIS for the Azure PFX requirements.


Create a .pfx/.p12 certificate file using OpenSSL @ ssl.com

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile more.crt

Breaking down the command:

  • openssl – the command for executing OpenSSL
  • pkcs12 – the file utility for PKCS#12 files in OpenSSL
  • -export -out certificate.pfx – export and save the PFX file as certificate.pfx
  • -inkey privateKey.key – use the private key file privateKey.key as the private key to combine with the certificate.
  • -in certificate.crt – use certificate.crt as the certificate the private key will be combined with.
  • -certfile more.crt – This is optional, this is if you have any additional certificates you would like to include in the PFX file.

I used the -certfile option to specify the GoDaddy bundle:

openssl pkcs12 -export -out my.pfx -inkey my.key -in my.crt -certfile gd_bundle-g2-g1.crt



回答3:


You can follow the steps provided on the support for installing SSL certificate.

Extracts from the above link.

Important Note: : To export the certificate in .pfx format you need to follow the steps on the same machine from which you have requested the certificate.



来源:https://stackoverflow.com/questions/14651599/certificate-issue-key-or-pfx-from-p7b-and-crt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!