gpt4 book ai didi

ssl - 将证书导入为 PrivateKeyEntry

转载 作者:行者123 更新时间:2023-11-28 21:53:45 26 4
gpt4 key购买 nike

我正在 Tomcat 服务器上安装 SSL,并遵循发行者的这些说明 https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=SO16181它指出:

Verify the following information:

The SSL certificate is imported into the alias with the "Entry Type" of
PrivateKeyEntry or KeyEntry. If not, please import the certificate into
the Private Key alias.

当我导入我正在使用的证书 (tomcat) 时:

keytool -import -trustcacerts -alias your_alias_name -keystore your_keystore_filename
-file your_certificate_filename

但是当我这样做时它导入为 trustCertEntry

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 3 entries

primaryca, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>
tomcat, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>
secondaryca, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>

如何将别名 tomcat 导入为 PrivateKeyEntry?

最佳答案

您尝试添加证书并期望它是私钥 - 这是两种不同事物之间的混淆。

通常,当您创建 keystore (.jks) 时,它会在其中包含私钥。如果它为空(已删除),您应该从您的 key 和证书生成 bundle (.p12 文件)。

为了创建新的免费 key 和证书,您可以使用这个 openSSL 的实现 https://zerossl.com .

然后,您获得了一个 key 和证书,您应该从中生成 (.p12) 捆绑文件:(在 linux 机器上)

openssl pkcs12 -export -in [filename-certificate] -inkey [filename-key] -name [host] -out [filename-new-PKCS-12.p12]

现在,只需通过执行以下命令将捆绑文件(.p12 文件)添加到 keystore (.jks):

keytool -importkeystore -deststorepass [password] -destkeystore [filename-new-keystore.jks] -srckeystore [filename-new-PKCS-12.p12] -srcstoretype PKCS12

关于ssl - 将证书导入为 PrivateKeyEntry,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15225858/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com