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
-1
votes
1 answer

Jar/code Singing certificate is expired and same certificate is renewed

I have web application, which is expired and renewed the same certificate and signed some part. Can it work? Suppose I have a.jar, b.jar and c.jar in my WEB-INF\lib and all jars have same package. Those are signed with certificate C1. Now…
skmdvcoep2000
  • 153
  • 2
  • 10
-1
votes
1 answer

Jarsigner War file

I have an applet of a third party in *.war format, i want to jarsign it with my verisign certificate in order to change this: Into this I have tried this way jarsigner -storetype pkcs12 -keystore CompanyCert.pfx -storepass myStorePass…
AMB
  • 995
  • 1
  • 12
  • 26
-1
votes
1 answer

Java application SSLSockets - Authentication

I'm developing a Java application and I need to send a couple strings to the server through a Secure Sockets, i have to use my own certificate generated by a trusted CA The file certificate is myOwnCRT.crt Client InputStream is = new…
darthlitox
  • 77
  • 1
  • 10
-1
votes
1 answer

sign .apk files ..getting jarsigner error:

I downloaded MyFiles.apk from internet and trying to do sign MyFiles.apk using jarsigner tool. I followed every step but getting jarsigner error: java.lang.RuntimeException:keystore load: D:\path_to_keystore\mykeystore.keystore(The system cannot…
sid123
  • 519
  • 1
  • 6
  • 7
-3
votes
1 answer

exclude in maven-jarsigner-plugin doesn't work

I have configured the jar signer plugin in my Project org.apache.maven.plugins maven-jarsigner-plugin 1.4
Jens
  • 67,715
  • 15
  • 98
  • 113
-6
votes
2 answers

prevent jar file from extracting

I don't want anyone extract my.jar file. I so obfuscated my code in my.jar but I want anyone can't extract it . I also know Jar_Signing don't help me. how?
Sam
  • 6,770
  • 7
  • 50
  • 91
1 2 3
22
23