Wednesday, November 24, 2010

Signing a Java app

I have been trying to run a java app which will open a port on a machine other than the one which it is downloaded from.  someone suggested a signed app would work, where an unsigned one does not.

Here is how to sign the app.  first you have to have the java sdk on your system.

use keytool to create an alias with a password.  Answer questions asked to create a key.  A file .keystore will be created with the certificate you create.

keytool -genkeypair -alias jws

Use jarsigner to sign the jar.  Use the alias you created above to sign the jar.

jarsigner VncViewer.jar jws (for example).

You will be for the password used in the keytools command.

Your jar will now cause a prompt when you load it on the browser with a query about if you trust the author.

This didn't fix the problem with the network, but it was useful enough to note.

http://download.oracle.com/javase/tutorial/deployment/jar/signing.html
http://download.oracle.com/javase/6/docs/technotes/guides/security/SecurityToolsSummary.html

Oracle trashed all the links into the Sun java pages when they moved them to their domain, so this information is probably linked to a million times, but the links now go to the generic oracle forum pages.  Still hunting for how to authorize a connection to another IP.

No comments:

Post a Comment