使用现有的私钥创建CSR [英] Create CSR using existing private key

查看:398
本文介绍了使用现有的私钥创建CSR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要做的是,创建一个CSR并使用受密码保护的私钥(密钥)。

What I am trying to do is, create a CSR and with a private key that is password protected (the key).

在OpenSSL中,我可以使用以下密码创建私钥:

In OpenSSL I can create a private key with a password like so:

openssl genrsa -des3 -out privkey.pem 2048

有一些方法,我可以使用key我刚刚创建并使用key生成一个CSR?

Is there some way I can use the key I just created and generate a CSR using the key?

如果没有,我可以用一种方式生成一个CSR和一个PASSWORD PROTECTED私钥吗?

If not is there some way I can generate a CSR along with a PASSWORD PROTECTED private key?

推荐答案

这是 OpenSSL req 的文档:


创建私钥,然后生成证书请求it:

Create a private key and then generate a certificate request from it:

openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out req.pem


请注意,如果直接使用 req (见第三个示例),如果不使用 -nodes 选项,您的私钥也将被加密:

Note that, if you do this directly with req (see 3rd example), if you don't use the -nodes option, your private key will also be encrypted:


openssl req -newkey rsa:1024 -keyout key.pem -out req.pem


(尽管文档说的是什么,例如,因为它不使用 -des3 ,但你也会这样做。)

(Despite what the documentation says, it's not exactly the same as the second example, since it doesn't use -des3, but you would have done so anyway.)

这篇关于使用现有的私钥创建CSR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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