未找到证书链,如何修复并发布到Google Play商店?

cam*_*ren 45 android keytool jar-signing jarsigner

错误消息:

jarsigner: Certificate chain not found for: project_foo.<br/>
project_foo must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
Run Code Online (Sandbox Code Playgroud)

问题:如何包含公钥证书链来解决错误?

背景:App Developer已经完成了一个Android应用程序,并提供了一个名为Foo.apk的未签名APK.我的目标是对APK进行签名和压缩,以准备将其上传到Google Play商店.我的密钥库位于Windows机器上的C:\ Path\.keystore中.

命令行,我的命令:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore C:\Path\\.keystore Foo.apk project_foo
Run Code Online (Sandbox Code Playgroud)

命令行,回复:

Enter Passphrase for keystore:
jarsigner: Certificate chain not found for: project_foo.<br/>
project_foo must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
Run Code Online (Sandbox Code Playgroud)

还试过:验证我记得正确的密码.使用命令行中的"keytool -list"向我显示预期的列表(它包含一个私钥).

以前的操作系统问题:使用Verisign 的文件询问未找到证书链.cer.我没有类似的文件可用.

其他信息:Windows 7计算机,使用标准Windows命令提示符.

Umi*_*aya 101

keytool -keystore formconnect.keystore -list -v

生成密钥后,可以使用此命令查找别名.

第一行执行包含别名:<value>如果使用keytool,则别名可能是"mykey".

打包应用程序时使用该别名.

  • 这应该标记为正确答案 (2认同)

tan*_*dar 11

我的命令也有同样的问题

生成密钥

 keytool -genkey -v -keystore testapp-key.keystore -alias testapp-key -keyalg RSA -keysize 2048 -validity 10000
Run Code Online (Sandbox Code Playgroud)

然后我这样做签署该应用程序

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore testapp-key.keystore testapp.apk testapp
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误

jarsigner: Certificate chain not found for: testapp.<br/>
project_foo must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
Run Code Online (Sandbox Code Playgroud)

然后我用jarsignir命令中的别名'testapp'替换了'testapp-key'的关键别名,它是第一个命令,即密钥生成命令

命令看起来像这样

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore testapp-key.keystore testapp.apk testapp
Run Code Online (Sandbox Code Playgroud)

在你的情况下,它会是这样的

 jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore C:\Path\\.keystore Foo.apk your-key-alias
Run Code Online (Sandbox Code Playgroud)