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

Migrating keystore of Android app versions (by signing twice?)

If I have access to the original keystore used to sign an Android apk is there a way to migrate future versions of the app to use a different keystore, preferably maintaining the ability to develop with ADT as though the second keystore had always…
BitBiter
  • 15
  • 4
0
votes
0 answers

Eclipse plugin : How to sign plugin folder

I'm using jarsigner to sign jar files successfully. But there are some jars found as folder (extracted form). Is there any command or option to pass this folder to the jarsigner and sign it?
becks
  • 2,656
  • 8
  • 35
  • 64
0
votes
1 answer

Maven Error in Eclipse - BPMN2 Modeler

my problem is the following. I have Eclipse Kepler SR1 and imported an maven project out of the following git: http://git.eclipse.org/c/bpmn2/.git/ This is a metamodel for the BPMN 2.0. After that i wanted to do a maven install but when i do this…
gope153
  • 85
  • 3
  • 13
0
votes
1 answer

Jad File Signature

I want to sign jad files. I checked the internet for *.jad file signature. I found this site I used this command for signing the jad file. Java -jar JadTool.jar -addcert -keystore -alias -storepass -inputjad…
dgn
  • 103
  • 5
  • 15
0
votes
1 answer

C# System.Diagnostics.Process.Start Cmd Jarsigner

I want to run specific code with C# windows application on cmd(command prompt) for sign jar file. I used this code System.Diagnostics.Process.Start(@"cmd", @"/K ""c:\program Files\Java\jdk1.6.0_23\bin\jarsigner.exe"" -keystore filepath.p12…
dgn
  • 103
  • 5
  • 15
0
votes
2 answers

Jarsigner: Signature Block missing for ANDROIDS

I have signed the apk, but when I tried to verify using jarsigner: jarsigner -verify -verbose -certs sample.signed.apk But I got an error saying: jarsigner: Signature Block missing for ANDROIDS I have no clue where I should look into this issue.…
Grace Huang
  • 5,355
  • 5
  • 30
  • 52
0
votes
2 answers

osgi security with signed war file

can anybody help me? I would like to use osgi security in my application. Therefore i wrote a security bundle, that grant all bundles that was signed by my keystore. One of my bundles is a war file (Bundle10). If i start the server (glassfish with…
bg89
  • 1
  • 4
0
votes
1 answer

Jar Deployment - Correct Order Of Execution of Steps

I am using allatori as an obfuscation tool. I have 24 jars required for an Applet , so i found the steps to compress the Jars to minimize downloading time, 1) Create uncompressed jars 2) Repack jars 3) Sign jars 4) Pack200 jars 5) finally apply…
Mihir
  • 2,480
  • 7
  • 38
  • 57
0
votes
2 answers

Running Jarsigner utility on android system

I want to create a security app and want to check if a downloaded application is not tampered with, I found a solution to verify app using the jarsigner utility but can i do it programatically? I have seen we can add binaries and use it…
Neji
  • 6,591
  • 5
  • 43
  • 66
0
votes
0 answers

How to sign jar on Mac OS X using installed .p12 certificate?

I am trying to sign myApp.jar on Mac OS X.I have installed p12 certificate on my Mac Os X machine. and to Sign app I use this following command - export…
Neelam Sharma
  • 2,745
  • 4
  • 32
  • 73
0
votes
1 answer

maven-jarsigner-plugin fails during Jenkins build but not on command line

Following environment given: Windows Server 2012 Java 1.6 Maven project with configured (assembly or shade plugin) AND jarsigner:sign/verify plugin Jenkins 1.518 running within Tomcat 7 (which runs with Java 1.7) Tomcat running as Windows Service…
0
votes
1 answer

Getting Exception: java.lang.SecurityException: attempted to open sandboxed jar as Trusted-Only

We need to sign all 5 .class java files. That we have done by creating a .jar file and signed it too. But while executing my web application it is showing below error message in Java Console java.lang.SecurityException: attempted to open sandboxed…
Ankur
  • 1
  • 1
  • 1
0
votes
1 answer

Jarsigner - Signer certificate not yet valid (AIR Application code signing to publish on Google Play)

I have created a Self-Signed Certificate in Mac OS using Keychain Access to be used as a certificate for my AIR Application. After exporting a release build for my app in Flash Builder 4.6, I have verified my apk using jarsigner by executing the…
vvns
  • 3,548
  • 3
  • 41
  • 57
0
votes
1 answer

Alias cannot be found in certificate keystore

I'm trying to sign a jar file using a code signing certificate. The alias name includes some special characters (Turkish characters). The alias name is similar to the following: bi?li?şi?m teknoloji?leri? eği?ti?m's comodo ca limited id When I try…
Zafer
  • 2,180
  • 16
  • 28
0
votes
0 answers

jarsigner from jdk1.6 prints warning when signing jar. jdk1.4 doesn't

If I use jarsigner from jdk1.6 to sign a jar file, the following warning is printed: Warning: The signer certificate has expired. If I use the same command to sign a jar file, but use jdk1.4 instead, the warning is not printed. I am thinking the…
ceklock
  • 6,143
  • 10
  • 56
  • 78