小编Ana*_*r H的帖子

为什么我必须从私钥创建证书请求(CSR)?

我正在尝试使用以下方法创建证书请求(CSR),我需要提供私钥,我的理解是CSR需要/仅包含公钥信息以及公司名称等请求者的其他详细信息.但是如果提取公钥并在创建CSR时传递它会抛出以下错误,所以我想知道它为什么需要私钥,虽然我理解私钥也包含公钥,是不是因为公钥是可信的什么时候使用密钥对或其他形式的私钥?

openssl genrsa -out ~/domain.com.ssl/domain.com.key 2048

openssl req -new -sha256 -key ~/domain.com.ssl/domain.com.key -out ~/domain.com.ssl/domain.com.csr
Run Code Online (Sandbox Code Playgroud)

尝试使用公钥生成:

openssl rsa -in  domain.com.key.pem -pubout domain.publickey

openssl req -new -sha256 -key domain.publickey -out cert.csr

unable to load Private Key
140258108909384:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY
Run Code Online (Sandbox Code Playgroud)

ssl openssl certificate csr private-key

2
推荐指数
1
解决办法
1364
查看次数

标签 统计

certificate ×1

csr ×1

openssl ×1

private-key ×1

ssl ×1