1

我正在尝试使用 keytool 函数创建一个公钥/私钥对,以便我可以将 Android 应用程序提交到 Google Play。当我尝试使用我制作的密钥对应用程序进行签名时,我从 jarsigner 收到此错误

jarsigner: Certificate chain not found for: SHA1withDSA.  
SHA1withDSA must reference a valid KeyStore 
key entry containing a private key and corresponding public key certificate chain.

当我尝试使用 RSA 时也是如此。当我查看密钥库的密钥时,我只看到
条目类型:PrivateKeyEntry

不是公钥和私钥。

我用来创建密钥的命令是

keytool -genkey -keystore nameofkeystore.keystore 
-alias coffitivity -keypass *passwordommitted* -storepass *thepasswordommitted*
4

1 回答 1

3

I'm not actually 100% sure what I did to fix it, but this is what I did and now it works

keytool -genkeypair -v -keystore my-release-key.keystore 
-alias coffdroid -keyalg RSA -keysize 2048 -validity 10000

Note: difference is I used "-genkeypair" instead of "genkey" even though they're supposed to be the same

Second: made a new unsigned .apk. This is likely what fixed it - so if you're hitting the wall, do that over.

Then Jarsigner

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 
-keystore my-release-key.keystore /Users/tommynicholas/Desktop/*apkname*.apk coffdroid
于 2013-10-04T18:21:32.973 回答