【问题标题】:Generating PFX file from crt and pem file从 crt 和 pem 文件生成 PFX 文件
【发布时间】:2022-08-16 13:47:48
【问题描述】:

我有以下文件:

  • root.crt
  • intermediate1.crt
  • intermediate2.crt
  • privatekey.pem

我试图用 openssl 生成一个 pfx 文件

openssl pkcs12 -export -out certificate.pfx -inkey privatekey.pem -in root.crt -certfile intermediate1.crt -certfile intermediate2.crt

这给了我以下错误:

No cert in -in file \'root.crt\' matches private key
68310000:error:05800074:x509 certificate routines:X509_check_private_key:key values mismatch:crypto\\x509\\x509_cmp.c:405:

我的私钥有问题吗?

标签: openssl certificate pfx


【解决方案1】:

root.crt 与私钥不匹配。使用正确的crt文件后,它起作用了。

【讨论】:

    【解决方案2】:

    用“-inkey file”指定的私钥应该与用“-in file”指定的证书匹配。

    【讨论】:

      最近更新 更多