【问题标题】:Convert a PEM certificate to a PKCS12 format将 PEM 证书转换为 PKCS12 格式
【发布时间】:2021-05-14 11:22:11
【问题描述】:

我有一个 PEM 格式,需要将其转换为 PKCS12 格式。以下命令用于转换,但没有发生转换。谁能帮帮我

openssl pkcs12 -export C:\sample keyStore.p12 -inkey server.pem C:\sample server.pem

【问题讨论】:

    标签: mongodb openssl certificate


    【解决方案1】:

    您需要一个证书文件以及一个(私有)密钥文件。

    作为示例,我们使用 RSA 算法生成一个新的私钥:

    openssl genrsa -f4 -out ".\private.key" 2048
    

    接下来我们根据密钥创建一个证书:

    openssl req -x509 -new -key ".\private.key" -out ".\certificate.pem"
    

    最后我们将两堆合并到 PFX/PKCS#12:

    openssl pkcs12 -inkey .\private.key -in .\certificate.pem -export -out .\certificateWithKey.pfx
    

    【讨论】:

      猜你喜欢
      • 2011-09-02
      • 1970-01-01
      • 2010-11-30
      • 2017-03-11
      • 1970-01-01
      • 2010-10-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多