Certificate chain not found, but keystore contains private key

故事扮演 提交于 2019-12-14 01:44:04

问题


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 my­release-key.keystore CordovaApp­release­unsigned.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.

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?


回答1:


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).

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

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).



来源:https://stackoverflow.com/questions/27543740/certificate-chain-not-found-but-keystore-contains-private-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!