• Increase font size
  • Default font size
  • Decrease font size

how to self-sign an applet

By default Java applications are considered safe to run, or in Java speak trusted, since they are executed explicitly by users on their own computers.

Applets by comparison are considered untrusted since they are initiated automatically in the browser. This restriction prevents applets from doing certain things, such as loading content from a different domain than the one hosting the applet. The error generated will look something like:

 

java.security.AccessControlException: access denied (java.net.SocketPermission some URL here connect,resolve).

To override this restriction, you can can sign the applet.

There are a couple different approaches to signing an applet, but they each involve connecting a certificate to your jar file. Certificates are digital signatures that incorporate a public key with some identity. There are companies (Certificate Authorities) that sell certificates for hundreds of dollars, but it is also possible to create a self-sign certificate for free, which is the approach shown below.

The select_image sketch below the instructions attempts to load an image from your computer using a standard file browser. When run as an applet, it needs to be signed.

Instructions:

Assume you have a sketch named loadImage.pde

Export your sketch as an applet, creating loadImage.jar. (Please note that if core.jar was also created, you have "Use multiple .jar files when exporting applets" checked in Processing's preferences window. I recommend unchecking this setting and re-exporting the sketch. Otherwise you'll need to sign both .jar files.

Open a terminal program and navigate to the applet directory where loadImage.jar is located.

 


keytool -genkey -keystore pKeyStore -alias p5geek
keytool -selfcert -keystore pKeyStore -alias p5geek
jarsigner -keystore pKeyStore AppletFile.jar p5geek

 

Upload your applet

(Obviously, replace AppletFile with the real name of your .jar file)

 

 

Add comment

No bad words.


Security code
Refresh


New articles

Differential Equations - Simple spring model Machine Learning and Robotics
Read More 1631 Hits
Kalman Filter implementation Machine Learning and Robotics
Read More 2412 Hits
Inverse kinematics Machine Learning and Robotics
Read More 2928 Hits
gpsim tutorial Machine Learning and Robotics
Read More 5255 Hits

New articles

Differential Equations - Simple spring model Machine Learning and Robotics
Read More 1631 Hits
Kalman Filter implementation Machine Learning and Robotics
Read More 2412 Hits
Inverse kinematics Machine Learning and Robotics
Read More 2928 Hits
gpsim tutorial Machine Learning and Robotics
Read More 5255 Hits
Design by i-cons.ch / etosha-namibia.ch