Kaspersky Security Center

将 PFX 证书转换为 PEM 格式

2024年6月17日

ID 201428

要在 Kaspersky Security Center Web Console 中使用 PFX 证书,必须首先使用任何方便的基于 OpenSSL 的跨平台实用程序将该证书转换为 PEM 格式。

要在 Linux 操作系统中将 PFX 证书转换为 PEM 格式:

  1. 在基于 OpenSSL 的跨平台实用程序中,执行以下命令:

    openssl pkcs12 -in <filename.pfx> -clcerts -nokeys | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > server.crt

    openssl pkcs12 -in <filename.pfx> -nocerts -nodes | sed -ne '/-BEGIN PRIVATE KEY-/,/-END PRIVATE KEY-/p' > key.pem

  2. 确保证书文件和私钥生成到存储 .pfx 文件的同一目录中。
  3. Kaspersky Security Center Web Console 不支持受密码保护的证书。因此,在基于 OpenSSL 的跨平台实用程序中运行以下命令,从 .pem 文件中删除密码:

    openssl rsa -in key.pem -out key-without-passphrase.pem

    输入和输出 .pem 文件不要使用相同名称。

    结果,新的 .pem 文件未加密。无需输入密码即可使用。

.crt 和 .pem 文件已可以使用,因此您可以在 Kaspersky Security Center Web Console 安装程序中指定它们。

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.