Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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? enter image description here

like image 753
tobbe Avatar asked Dec 28 '25 10:12

tobbe


1 Answers

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

like image 130
Omikron Avatar answered Dec 31 '25 03:12

Omikron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!