证书链没有找到,但密钥存储库包含私有密钥 [英] Certificate chain not found, but keystore contains private key
问题描述
我试着让我签字的apk这样我就可以发布一个更新我的应用程序使用此命令:的jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myrelease-key.keystore CordovaAppreleaseunsigned.apk ALIAS_NAME
,但得到这个错误:
Im trying to sign my apk so I can release an update to my app with this command: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myrelease-key.keystore CordovaAppreleaseunsigned.apk alias_name
but getting this error:
jarsigner: Certificate chain not found for: ¡sigalg. ¡sigalg must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
从来就刚搬到一个新的电脑,所以我抄我的.keystore文件给它。当我做的keytool -list -v
看起来它包含了私钥,所以我不明白什么是错..是公钥失踪?
I´ve just moved to a new computer so I copied my .keystore file to it. When I do keytool -list -v
it seems like it contains the private key, so I dont understand whats wrong.. Is the public key missing?
推荐答案
显然,这是一个编码问题。该命令包含一个看上去类似于一个减号字符(ASCII code 0x2D),但实际上是许多破折号或连字符中的一个(的 http://en.wikipedia.org/wiki/Dash )。
Obviously it was an encoding issue. The command contained characters that looked similar to a minus sign (ASCII code 0x2D), but actually were one of the many dash or hyphen characters (http://en.wikipedia.org/wiki/Dash).
由于错误的字符code中的第一个参数 -verbose
被认可的jarsigner不是一种选择,而是为jar文件和名称的 -sigalg
被认定为别名:
Because of the wrong character code the first parameter "-verbose
" was recognised by jarsigner not as an option but as the name of the jar file and "-sigalg
" was recognised as the alias:
Usage: jarsigner [options] jar-file alias
这解释了为什么错误消息的别名是¡sigalg
,而不是该命令的实际别名,并在一开始包含了一个倒置的感叹号本使用(成为 - ,在另一个字符集)。
This explains why the alias in the error message was "¡sigalg
" and not the actual alias from the command and contained an inverted exclamation mark at the beginning (this used to be the "-" in another character set).
这篇关于证书链没有找到,但密钥存储库包含私有密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!