我需要pfx文件来安装IIS网站上的https。
我有两个单独的文件:证书(。cer或pem)和私钥(.crt),但IIS只接受.pfx文件。
我显然安装了证书,它在证书管理器(mmc)中可用,但当我选择证书导出向导时,我无法选择PFX格式(它是灰色的)
有什么工具可以做到这一点吗?或者c#中有编程的例子吗?
我需要pfx文件来安装IIS网站上的https。
我有两个单独的文件:证书(。cer或pem)和私钥(.crt),但IIS只接受.pfx文件。
我显然安装了证书,它在证书管理器(mmc)中可用,但当我选择证书导出向导时,我无法选择PFX格式(它是灰色的)
有什么工具可以做到这一点吗?或者c#中有编程的例子吗?
当前回答
你不需要openssl或makecert或任何。你也不需要CA给你的个人密钥。我几乎可以保证,问题是你希望能够使用CA提供的密钥和cer文件,但它们不是基于“IIS方式”。
SSL证书IIS与PFX一劳永逸- SSL和IIS解释- http://rainabba.blogspot.com/2014/03/ssl-certs-for-iis-with-pfx-once-and-for.html
Use IIS "Server Certificates" UI to "Generate Certificate Request" (the details of this request are out of the scope of this article but those details are critical). This will give you a CSR prepped for IIS. You then give that CSR to your CA and ask for a certificate. Then you take the CER/CRT file they give you, go back to IIS, "Complete Certificate Request" in the same place you generated the request. It may ask for a .CER and you might have a .CRT. They are the same thing. Just change the extension or use the . extension drop-down to select your .CRT. Now provide a proper "friendly name" (*.yourdomain.example, yourdomain.example, foo.yourdomain.example, etc..) THIS IS IMPORTANT! This MUST match what you setup the CSR for and what your CA provided you. If you asked for a wildcard, your CA must have approved and generated a wildcard and you must use the same. If your CSR was generated for foo.yourdomain.example, you MUST provide the same at this step.
其他回答
需要使用makecert工具。
以管理员身份打开命令提示符,输入以下命令:
makecert -sky exchange -r -n "CN=<CertificateName>" -pe -a sha1 -len 2048 -ss My "<CertificateName>.cer"
其中<CertifcateName> =要创建的证书的名称。
然后,您可以通过键入certmgr打开管理控制台的证书管理器管理单元。在开始菜单中,单击个人>证书>,您的证书应该可用。
这是一篇文章。
https://azure.microsoft.com/documentation/articles/cloud-services-certs-create/
这是迄今为止最简单的转换方法。Cer到*。可以文件:
只需从DigiCert下载便携式证书转换器: https://www.digicert.com/util/pfx-certificate-management-utility-import-export-instructions.htm
执行它,选择一个文件,并得到你的*.pfx!!
我写了一个小控制台应用程序,它可以将PEM证书文件和私钥文件转换为一个.pfx PKCS12证书文件。 它使用BouncyCastle库。
我的Github回购:https://github.com/nklkli/PEM-to-PKCS12
请随意修改代码以创建密码保护的*.pfx。
你不需要openssl或makecert或任何。你也不需要CA给你的个人密钥。我几乎可以保证,问题是你希望能够使用CA提供的密钥和cer文件,但它们不是基于“IIS方式”。
SSL证书IIS与PFX一劳永逸- SSL和IIS解释- http://rainabba.blogspot.com/2014/03/ssl-certs-for-iis-with-pfx-once-and-for.html
Use IIS "Server Certificates" UI to "Generate Certificate Request" (the details of this request are out of the scope of this article but those details are critical). This will give you a CSR prepped for IIS. You then give that CSR to your CA and ask for a certificate. Then you take the CER/CRT file they give you, go back to IIS, "Complete Certificate Request" in the same place you generated the request. It may ask for a .CER and you might have a .CRT. They are the same thing. Just change the extension or use the . extension drop-down to select your .CRT. Now provide a proper "friendly name" (*.yourdomain.example, yourdomain.example, foo.yourdomain.example, etc..) THIS IS IMPORTANT! This MUST match what you setup the CSR for and what your CA provided you. If you asked for a wildcard, your CA must have approved and generated a wildcard and you must use the same. If your CSR was generated for foo.yourdomain.example, you MUST provide the same at this step.
我有你要求的链接。使用OpenSSL将CRT和KEY文件合并为PFX
以上连结摘录:
First we need to extract the root CA certificate from the existing .crt file, because we need this later. So open up the .crt and click on the Certification Path tab. Click the topmost certificate (In this case VeriSign) and hit View Certificate. Select the Details tab and hit Copy to File… Select Base-64 encoded X.509 (.CER) certificate Save it as rootca.cer or something similar. Place it in the same folder as the other files. Rename it from rootca.cer to rootca.crt Now we should have 3 files in our folder from which we can create a PFX file. Here is where we need OpenSSL. We can either download and install it on Windows, or simply open terminal on OSX.
编辑:
有一个支持链接,提供了关于如何安装证书的分步信息。 安装成功后,导出证书,选择.pfx格式,包含私钥。 重要提示:要以.pfx格式导出证书,您需要在请求证书的同一台机器上执行以下步骤。 导入的文件可以上传到服务器。