gpt4 book ai didi

java - 目标 pkcs12 keystore 具有不同的 storepass 和 keypass。请使用指定的 -destkeypass 重试

转载 作者:行者123 更新时间:2023-12-01 17:25:14 27 4
gpt4 key购买 nike

我是 key 生成新手。当我跟进这些步骤时,出现如下错误...

D:\My_Personal_Projects\springblog>keytool -importkeystore -srckeystore springblog.jks -destkeystore springblog.jks -deststoretype pkcs12"
Enter source keystore password:
Enter key password for <springblog>
keytool error: java.lang.Exception: The destination pkcs12 keystore has different storepass and keypass. Please retry with -destkeypass specified.

以下是我所经历的步骤

D:\My_Personal_Projects\springblogfrontend>cd springblogfrontend

D:\My_Personal_Projects\springblogfrontend\springblogfrontend>keytool -genkey -alias springblog -keyalg RSA --keystore springblog.jks
-keysize 2048
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: Niroshan
What is the name of your organizational unit?
[Unknown]: springblog
What is the name of your organization?
[Unknown]:
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]:

Is CN=Niroshan, OU=springblog, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
[no]: yes

Enter key password for <springblog>
(RETURN if same as keystore password):
Re-enter new password:

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore springblog.jks -destkeystore springblog.jks -deststoretype pkcs12".

D:\My_Personal_Projects\springblogfrontend\springblogfrontend>keytool -importkeystore -srckeystore springblog.jks -destkeystore springblog.jks -deststoretype pkcs12
Enter source keystore password:
Enter key password for <springblog>
keytool error: java.lang.Exception: The destination pkcs12 keystore has different storepass and keypass. Please retry with -destkeypass specified.

什么原因导致这个错误?非常感谢任何帮助

最佳答案

发生此错误是因为您的 keystore 中有两个不同的密码。第一个是 keystore 密码(或 storepass),请查看这些行:

Enter keystore password:
Re-enter new password:

第二个是您别名的 key 密码(或keypass),keytool 在 keystore 生成结束时要求输入此密码,请查看这些行:

Enter key password for <springblog>
(RETURN if same as keystore password):
Re-enter new password:

以下是解决 keytool 错误问题的两个选项:

  1. 当 keytool 要求输入 key 密码时,只需按照建议按 RETURN,然后 keytool -importkeystore -srckeystore springblog.jks -destkeystore springblog.jks -deststoretype pkcs12将按预期工作,没有任何错误。
  2. 添加-destkeypass当您执行上述迁移/导入命令时,请使用您的 key 密码(别名密码)选项。在这种情况下,keytool 会向您发出警告 Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -destkeypass value. ,但导入会成功完成。

关于java - 目标 pkcs12 keystore 具有不同的 storepass 和 keypass。请使用指定的 -destkeypass 重试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61221140/

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