OK, here we go:

'keytool' is delivered with Sun's development kit.

 keytool -genkey -keyalg rsa -alias yourkey
Follow the instructions and type in all needed information.

Now we make the certificate:
 keytool -export -alias yourkey -file yourcert.crt

Now we have to sign the applet:

Just make a *.bat file including this:

javac yourapplet.java
jar cvf yourapplet.jar yourapplet.class
jarsigner yourapplet.jar yourkey

The batch-file compiles the applet, makes a jar-archive and signs the jar-file.

The HTML-code to display the applet:

<applet code="yourapplet.class" archive="yourapplet.jar" width="600" height="500">
</applet>


Now we are done! The applet is signed and if the user accepts
the certificate, the applet is allowed to access local files.
If the user doesn't agree, this appears in the console:
Original Source:: http://www.captain.at/program...