Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the Java 1.6 and 1.7 jarsigner

Just noted that you can´t sign Android APKs with the Java 1.7 jarsigner. So I wonder why this is and what is the difference between the 1.6 and 1.7 signer?

like image 207
Martin Avatar asked Jan 05 '12 08:01

Martin


2 Answers

This is because the default digest algorithm for Java 1.7 is SHA-256 while for Java 1.6 it's SHA1withDSA.

Java 1.6 Jarsigner docs

Java 1.7 Jarsigner docs

like image 155
Funky coder Avatar answered Oct 18 '22 09:10

Funky coder


Yes you CAN use 1.7!

It is very tricky to find info on the usage with 1.7, but once found it is reasonable simple:

For keytool include

-sigalg SHA1withDSA -keyalg DSA -keysize 1024

For jarsigner include

-sigalg SHA1withDSA -digestalg SHA1

(1024 is the maximum and works, less might do the trick)

like image 6
Eske Rahn Avatar answered Oct 18 '22 09:10

Eske Rahn