Questions tagged [jarsigner]

jarsigner - JAR Signing and Verification Tool Generates signatures for Java ARchive (JAR) files, and verifies the signatures of signed JAR files.

The jarsigner tool is used for two purposes:

  1. to sign Java ARchive (JAR) files, and
  2. to verify the signatures and integrity of signed JAR files.

The JAR feature enables the packaging of class files, images, sounds, and other digital data in a single file for faster and easier distribution. A tool named jar enables developers to produce JAR files. (Technically, any zip file can also be considered a JAR file, although when created by jar or processed by jarsigner, JAR files also contain a META-INF/MANIFEST.MF file.)

A digital signature is a string of bits that is computed from some data (the data being "signed") and the private key of an entity (a person, company, etc.). Like a handwritten signature, a digital signature has many useful characteristics:

Its authenticity can be verified, via a computation that uses the public key corresponding to the private key used to generate the signature. It cannot be forged, assuming the private key is kept secret. It is a function of the data signed and thus can't be claimed to be the signature for other data as well.

The signed data cannot be changed; if it is, the signature will no longer verify as being authentic.

In order for an entity's signature to be generated for a file, the entity must first have a public/private key pair associated with it, and also one or more certificates authenticating its public key. A certificate is a digitally signed statement from one entity, saying that the public key of some other entity has a particular value.

jarsigner uses key and certificate information from a keystore to generate digital signatures for JAR files. A keystore is a database of private keys and their associated X.509 certificate chains authenticating the corresponding public keys. The keytool utility is used to create and administer keystores.

jarsigner uses an entity's private key to generate a signature. The signed JAR file contains, among other things, a copy of the certificate from the keystore for the public key corresponding to the private key used to sign the file. jarsigner can verify the digital signature of the signed JAR file using the certificate inside it (in its signature block file).

Starting in J2SE 5.0, jarsigner can generate signatures that include a timestamp, thus enabling systems/deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid. In addition, APIs were added in J2SE 5.0 to allow applications to obtain the timestamp information.

At this time, jarsigner can only sign JAR files created by the SDK jar tool or zip files. (JAR files are the same as zip files, except they also have a META-INF/MANIFEST.MF file. Such a file will automatically be created when jarsigner signs a zip file.)

The default jarsigner behavior is to sign a JAR (or zip) file. Use the -verify option to instead have it verify a signed JAR file.

Official source: http://docs.oracle.com/javase/8/docs/technotes/tools/windows/jarsigner.html

336 questions
0
votes
1 answer

ANT build: [signjar] enter passphrase for keystore:

I have created a project in eclipse and while trying to build the project from command prompt the following is asked: [signjar] jarsigner error: java.lang.RuntimeException: keystore load: C:\Documents and Settings\Gopakumar\.keystore (The system…
Gopakumar N G
  • 1,775
  • 1
  • 23
  • 40
0
votes
1 answer

My corona sdk project won't build properly on Android

I have posted about this problem on the Corona forums, but was not able to get an answer there. http://forums.coronalabs.com/topic/29712-android-failure-install-parse-failed-certificate-encoding/ Basically the problem is that my project runs fine in…
ryosua
  • 65
  • 1
  • 2
  • 11
0
votes
0 answers

Sign jar file by java code

I have a question. When I sign my JAR file, which I will open as an applet, I use Command Prompt and command: jarsigner -keystore But is it possible to do this by using only Java? I would start my JAR…
vrbadev
  • 455
  • 1
  • 7
  • 20
0
votes
1 answer

Why won't my jarsigner work?

For some reason why I try any command including just jarsigner it gives me the following error: Error: Could not find or load main class sun.security.tools.JarSigner Do I have an incorrect version of Java? I've re-installed Java many times and…
Ajay
  • 437
  • 7
  • 22
0
votes
1 answer

Signing application in cmd with jarsigner

I've been following this tutorial on How to sign your app before publishing and everything works fine until the last step, number 6. When I enter my pass, i get this error jarsigner error: java.lang.RuntimeException: keystore load:…
Vladimir
  • 1,243
  • 5
  • 19
  • 23
0
votes
3 answers

sign a Jar file

I have manually added some class files in jar. and replaced in server. But server didn't come up with this new jar saying : java.lang.SecurityException: class "test.TestProcess2"'s signer information does not match signer information of other…
John
  • 2,035
  • 13
  • 35
  • 44
0
votes
1 answer

using keytool and jarsigner to sign my app

I'm using both my commonsware book and the android docs that describe how to sign my app. But there is something I don't understand... I have generated my KeyStore file with no problem. Now the commonsware book says to "Build a Release Version…
Dean Blakely
  • 3,535
  • 11
  • 51
  • 83
0
votes
1 answer

Shell passing keystore path parameter in jarsigner

I have this KEY_STORE_PATH=/home/userr/mykeystore jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore "$KEY_STORE_PATH" bin/PName-release-unsigned.apk alias_name and it doesn't work, after this command the apk file it is not…
Lukap
  • 31,523
  • 64
  • 157
  • 244
0
votes
1 answer

How do I sign amazon apk?

I am trying to sign an amazon wrapped apk so i can load my app to the amazon app store. I have to do this because my app uses Google Apis. All the tutorials on this are complicated when it comes to explaining how to use jarsigner. How do I access…
B. Money
  • 931
  • 2
  • 19
  • 56
0
votes
1 answer

jarsigner verification fails

Using freshly installed JDK 1.7 we sign the JAR file. Immediately after that we verify it using the same jarsigner and the same keystore and ... it fails with the message: invalid SHA256 hash on ... The signing/verification code is trivial (two…
Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
0
votes
1 answer

How to solve keystore load: invalid keystore formtat?

I'm getting a releasekey to my app Three months ago. Now I format my computer and when I was sign my app with my releasekey i got the error: java.lang.RunTimeException: keystore load: invalid keystore format. How I should solve this error? The…
weldsonandrade
  • 606
  • 1
  • 9
  • 25
0
votes
1 answer

How to extract the apk file using the jarsigner to get the key?

How to extract the apk file using the jarsigner to get the keystore to update my Android application?
Rajesh Kumar
  • 6,868
  • 3
  • 15
  • 15
0
votes
3 answers

Author is unknown for signed jar

Signing jar in Java, I have followed these three step to sign keytool -genkey -keystore myKeyStore -alias me keytool -selfcert -keystore myKeyStore -alias me jarsigner -keystore myKeyStore jarfile.jar me My questions are as follows : After that…
Mohan
  • 85
  • 1
  • 8
0
votes
0 answers

Managing keystore within jar file

I have a maven project which needs to be signed. To sign the jar file, I created an alias. This will be stored in my .keystore. Using the alias, I'm signing the jar, everytime a new version is created. Is it possible to make the keystore to be…
user691197
  • 927
  • 6
  • 20
  • 38
-1
votes
1 answer

When i use jarsigner for sign my apk error message apeared

when i use jarsigner for sign my apk .i use it command C:\>jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks android-release-unsigned.apk my-alias Enter Passphrase for keystore: but it say : jarsigner: unable…
1 2 3
22
23