|
How to sign applets
|
|
Tuesday, August 24, 2004
All content and software implementations are not Ericsson-supported products. Note that Ericsson does not represent nor hold responsibility for the content from this area. In the Java Security Model, applets are considered mobile code, and as a side effect they are not trusted and executed in a sandbox in which they have limited functionality:
You can sign an applet to easily overcome this limitation without rewriting code or requiring the user to install a policy file. The first thing you have to create is a public key, which is done in a few steps: # Create key and keystore You should type what is written above in italics. The keytool is an interactive program that lets you create a keystore that will contain a cryptographic key pair. The program keytool is provided with any J2SE SDK, just make sure it is in your execution path. An alias is the name given to a particular key pair inside the keystore. A keystore can hold many keys; therefore an alias is required for each one. Next you have to pack your applet and related resources in a JAR file. To learn how to pack applets refer to http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html. # Sign applet with the keystore With the JAR file signed the next step is to change your HTML code to use the signed JAR file.
Click on “Yes” and your applet should work without restrictions. To avoid warning signs appearing when loading the certificate, you must send your certificate to a Certificate Authority (CA), which is trusted in a default JVM setup, import the certificate into your keystore and sign the JAR file with the new certificate. For more information on how to import a certificate refer to: http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html Avelino Benavides Reference: Last published February 17, 2007
|
|