Bhavika Patel
Bhavika Patel

Reputation: 35

Phonegap APK - jarsigner -verify throwing an error - invalid SHA-256 signature file digest for res/layout/notification_action.xml

I have created the keystore using

keytool -genkey -v -keystore xx_yy_zz.keystore -alias xx_yy_zz_alias_name -keyalg RSA -keysize 2048 -validity 10000

Uploaded to Phonegap and generated a APK file

The signed the APK using the below command

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore xx_yy_zz.keystore xx_yy_zz.78.apk xx_yy_zz_alias_name

But when I verify the APK it throws the below error

jarsigner -verify xx_yy_zz.78.apk

Error:

jarsigner: java.lang.SecurityException: invalid SHA-256 signature file digest for res/layout/notification_action.xml

Upvotes: 1

Views: 3910

Answers (1)

Martin Zeitler
Martin Zeitler

Reputation: 76779

Use -digestalg SHA-256 to sign, if you wish to verify SHA256.

SHA1 had been broken and should not be used anymore, at all.

Upvotes: 3

Related Questions