简体   繁体   中英

Certificate chain not found, but keystore contains private key

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.

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? 在此输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM