John
John

Reputation: 2141

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 classes in the same package.

Do i need to sign the jar after updation and how to do the same.

Thanks in advance

Upvotes: 0

Views: 2032

Answers (3)

dstronczak
dstronczak

Reputation: 2454

Yes.

You can also sign the jar manually for the command line. For example, in windows it looks moreless liek that:

"{YOUR_JDK_INSTALL_PATH}\bin\jarsigner.exe" -verbose -keystore {YOUR_KEYSTORE_PATH} -storepass {YOUR_STORE_PASS} -keypass {YOUR_KEY_PASS} {JAR_FILE}

Upvotes: 1

Tom
Tom

Reputation: 3166

The problem is that the other classes in your JAR are signed differently than the classes that you added. Either don't sign the entire JAR or resign the JAR after you add the new classes. You can find information on the jarsigner tool here

Upvotes: 1

Nikolay Kuznetsov
Nikolay Kuznetsov

Reputation: 9579

Do i need to sign the jar after updating?

Sure, it is the point of signing jars that the content is not modified by some else except you. If you modify it manually, then you have to resign.

In my case I use Eclipse and Ant to build the project. So the jar gets resigned every time I rebuild the project.

<signjar jar="myapplet.jar" keystore="myKeyStore" alias="me" storepass="pass"/>

Upvotes: 1

Related Questions