【发布时间】:2014-02-04 03:30:04
【问题描述】:
使用openssl,我创建了一个私钥,如下所示:
openssl genrsa -out myKey.pem
然后,为了生成 CA 要求的 csr,我执行了以下操作:
openssl req -new -key myKey.pem -out cert.csr
CA 以我存储在名为 myCert.cer 的文件中的证书作为响应
我现在想将必要的组件(私钥、公钥(?)和证书)捆绑到一个 .p12 中。为此,我运行了以下命令:
openssl pkcs12 -export -out keyStore.p12 -inkey myKey.pem -in myCert.cer
但我收到以下错误消息:
No certificate matches private key
我怎样才能做到这一点?
【问题讨论】:
-
顺便说一句,如果有人想自己签名
cert.csr,那么可以使用openssl x509 -req -in cert.csr -signkey key.pem -out cert.crt,然后使用openssl pkcs12 -export -in cert.crt -inkey key.pem -out cert.p12。无需使用答案中的附加命令。
标签: openssl certificate pkcs#12