Java 密钥库:删除密码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21531386/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 09:11:56  来源:igfitidea点击:

Keystore: delete password

javaandroidkeytool

提问by kagali-san

I have a keystore (keytool key storage), which is used for signing .apk's from Eclipse-ADT. Due to the extremely annoying password requests at each export, I'm trying to figure out how to avoid reentering password.

我有一个密钥库(keytool 密钥存储),用于从 Eclipse-ADT 签署 .apk。由于每次导出时都需要非常烦人的密码请求,我试图找出如何避免重新输入密码。

My current options are:

我目前的选择是:

  • by using Perl/X1::::XTEST, automate password entering (insecure)
  • hack Eclipse to cache passwords (potentially insecure, explicit timeloss)
  • remove keystore password, which seems to be the best possible idea
  • 通过使用 Perl/X1::::XTEST,自动输入密码(不安全)
  • 破解 Eclipse 以缓存密码(可能不安全,显式时间损失)
  • 删除密钥库密码,这似乎是最好的主意

Attempt to set empty password failed:

尝试设置空密码失败:

>> keytool -keystore /work/X/googleplay.key -alias X -keypasswd
Enter keystore password:  
New key password for <X>: 
Password is too short - must be at least 6 characters
New key password for <X>: 
Password is too short - must be at least 6 characters
New key password for <X>: 
Password is too short - must be at least 6 characters
keytool error: java.lang.Exception: Too many failures - try later

采纳答案by rxg

JKS keystores can't be used without a password. The best option is to pass your keystore password on the command line somehow - for example, instead of using the ADT to sign your files, trigger an antbuild like in this answer.

没有密码就不能使用 JKS 密钥库。最好的选择是以某种方式在命令行上传递您的密钥库密码 - 例如,不是使用 ADT 来签署您的文件,而是触发一个ant这个答案中的构建。

If you really want to have a passwordless keystore your only option is to write your own implementation of KeyStore(although you still have to be able to tell your signing tools to use it) - see the Oracle documentationfor more details.

如果您真的想要一个无密码的密钥库,您唯一的选择是编写您自己的实现KeyStore(尽管您仍然必须能够告诉您的签名工具使用它) -有关更多详细信息,请参阅Oracle 文档