简体   繁体   English

java.io.IOException:无效的密钥库格式/无法识别的密钥库格式。 使用旧的 android 密钥库时,请以指定的类型加载它

[英]java.io.IOException: Invalid keystore format / Unrecognized keystore format. Please load it with a specified type, when using an old android keystore

I tried to sign an old Android application with Android Studio 4.0.1 (which I successfully signed say, 1 year ago) and it seems the keystore cannot be open anymore.我尝试使用 Android Studio 4.0.1(我在 1 年前成功签署)签署了旧的 Android 应用程序,看来密钥库无法再打开了。 I checked the credentials carefully but I don't think it comes from that.我仔细检查了凭据,但我不认为它来自那里。 I also checked the various answers with "Invalid keystore format" on the Internet but get no luck here.我还在互联网上使用“无效的密钥库格式”检查了各种答案,但在这里没有运气。

The android JRE raises this error: android JRE 引发此错误:

$ /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/jre/bin/keytool -list -keystore android.keystore -v
erreur keytool : java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:663)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56)
    at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
    at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at sun.security.tools.keytool.Main.doCommands(Main.java:823)
    at sun.security.tools.keytool.Main.run(Main.java:366)
    at sun.security.tools.keytool.Main.main(Main.java:359)

$ /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/jre/bin/java -version
openjdk version "1.8.0_242-release"
OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
OpenJDK 64-Bit Server VM (build 25.242-b3-6222593, mixed mode)

It is quite the same message with the OS one:这是与操作系统完全相同的消息:

$ keytool -list -keystore android.keystore -v
keytool error: java.security.KeyStoreException: Unrecognized keystore format. Please load it with a specified type
java.security.KeyStoreException: Unrecognized keystore format. Please load it with a specified type
    at java.base/java.security.KeyStore.getInstance(KeyStore.java:1809)
    at java.base/java.security.KeyStore.getInstance(KeyStore.java:1680)
    at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:936)
    at java.base/sun.security.tools.keytool.Main.run(Main.java:417)
    at java.base/sun.security.tools.keytool.Main.main(Main.java:410)

$ java --version
openjdk 14.0.2 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-46)
OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)

I think I have already met this issue in the past and had to revert to an older version of the JRE to keep on opening my keystore properly (solution I am currently trying now).我想我过去已经遇到过这个问题,必须恢复到旧版本的 JRE 才能继续正确打开我的密钥库(我现在正在尝试的解决方案)。

  • Is this a question of default algorithm that changed between versions?这是版本之间更改的默认算法的问题吗? If yes, how can I check my keystore is still valid and that I use a correct algorithm (since I did not create it unfortunately)?如果是,我如何检查我的密钥库是否仍然有效并且我使用了正确的算法(因为不幸的是我没有创建它)?
  • Do I need to migrate the keystore somehow?我是否需要以某种方式迁移密钥库?

In my case I found the solution by deleting the existing .jks file in the existing path .就我而言,我通过删除现有路径的现有.jks文件找到了解决方案。

Either choose a new path to export or delete .选择新路径导出或删除 Before deleting I would recommend taking a backup.在删除之前,我建议进行备份。

I think I have already met this issue in the past and had to revert to an older version of the JRE to keep on opening my keystore properly (solution I am currently trying now).我想我过去已经遇到过这个问题,必须恢复到旧版本的 JRE 才能继续正确打开我的密钥库(我现在正在尝试的解决方案)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无效的密钥库格式:java.io.IOException:无效的密钥库格式 - Invalid keystore format: java.io.IOException: Invalid keystore format java.io.IOException:无效的密钥库格式 - java.io.IOException: Invalid Keystore format java.io.IOException:使用 Tomcat 服务器的密钥库格式无效 - java.io.IOException: Invalid keystore format using Tomcat server Tomcat java.io.IOException:通过 Classloader 加载密钥库时密钥库格式无效 - Tomcat java.io.IOException: Invalid keystore format when loading keystore via Classloader SSL Java java.io.IOException:密钥库格式无效 - SSL Java java.io.IOException: Invalid keystore format javamail java.io.IOException:无效的密钥库格式 - javamail java.io.IOException: Invalid keystore format Java.io.IOException:定制Web服务器的无效密钥库格式 - Java.io.IOException: Invalid keystore format for custom web server 密钥工具错误:java.io.IOException:密钥库格式无效 - keytool error: java.io.IOException: Invalid keystore format java.io.IOException:使用 .cer 文件对 pdf 进行数字签名时获取的密钥库格式无效 - java.io.IOException: Invalid keystore format getting while signing pdf digitally using .cer file 生成最终归档文件时出现错误:java.io.IOException:无效的密钥库格式 - Getting Error generating final archive: java.io.IOException: Invalid keystore format
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM