Applets are protected in a sandbox but are able to access resources outside the sandbox if the user establishes trust via signing the applet with a valid certificate.
Most companies have their own certificates but for the demonstration purposes of this program we will create our own certificate.
The applet for this demonstration will allow the user to launch applications such as calculator and notepad through the applet. Applications which can be launched normally through the dos command window.
I know this works in IE, and the applet which launches the applications can be viewed App launcher demo.
All source code can be downloaded here
There are some steps involved to achieve this:
1. Write the applet
2. Jar the applet
3. Make a certificate if you do not already have one and sign the jar file
4. Publish applet
1. Compile AppLauncherApplet.java made for jdk 1.5 but can probably be easily modified
2. jar up application jar cvf AppLauncherApplet.jar *.class
3. Sign jar file (See below to create RSA keypair if not done already)jarsigner -verbose -keystore launcherkeystore -signedjar SignedAppLauncherAppletLauncher.jar AppLauncherApplet.jar launcheraliasEnter Passphrase for keystore: launcher updating: META-INF/MANIFEST.MF adding: META-INF/LAUNCHER.SF adding: META-INF/LAUNCHER.RSA signing: AppLauncherApplet.class
3b. Verify that it is signed jarsigner -verify -verbose -certs SignedAppLauncherApplet.jar
Create RSA keypair and self-signed certificate(Requirement to sign applet)
keytool -genkey -alias launcheralias -keyalg RSA -validity 365 -keystore launcherkeystore
Enter keystore password: launcherWhat is your first and last name? [Unknown]: Collin Smith
What is the name of your organizational unit? [Unknown]:CollinBlogDeptWhat is the name of your organization? [Unknown]: CollinBlog
What is the name of your City or Locality? [Unknown]: Calgary
What is the name of your State or Province? [Unknown]: AB
What is the two-letter country code for this unit? [Unknown]: CA
Is CN=Collin Smith, OU=CollinBlogDept, O=CollinBlog, L=Calgary, ST=AB, C=CA correct? [no]: y
Enter key password for
(View fingerprints of certificates in keystore)
keytool -list -keystore launcherkeystore
(View personal information about the issuer and owner of the certificate)
keytool -list -v -keystore launcherkeystore
(Remove entries from the keystore) keytool -keystore launcherkeystore -delete -alias launcheralias