如何从证书和私钥创建.pfx文件? [英] How to create .pfx file from certificate and private key?

查看:1189
本文介绍了如何从证书和私钥创建.pfx文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要.pfx文件在IIS上的网站上安装https。



我有两个单独的文件:证书(.cer或pem)和私钥(.crt),但IIS只接受.pfx文件。



我显然安装了证书,它在证书管理器(mmc)中可用,但是当我选择证书导出向导时,我不能选择PFX格式(灰色)


$ b $

解决方案

您需要使用openssl 。



openssl pkcs12 -export -out domain.name.pfx -inkey domain.name.key -in domain.name.crt



密钥文件只是一个带有您的私钥的文本文件。



可以从这里安装openssl: openssl


I need .pfx file to install https on website on IIS.

I have two separate files: certificate (.cer or pem) and private key (.crt) but IIS accepts only .pfx files.

I obviously installed certificate and it is available in certificate manager (mmc) but when I select Certificate Export Wizard I cannot select PFX format (it's greyed out)

Are there any tools to do that or C# examples of doing that programtically?

解决方案

You will need to use openssl.

openssl pkcs12 -export -out domain.name.pfx -inkey domain.name.key -in domain.name.crt

The key file is just a text file with your private key in it.

You can install openssl from here: openssl

这篇关于如何从证书和私钥创建.pfx文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆