Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : S words : signed Applets.
Signed Applets are dangerous. They have power to potentially damage your machine. Just because an Applet is signed does not make it safe. Anyone, even a terrorist, can write a signed Applet. There are four main schemes for oking these dangerous signed Applets to run on your machine.
Unless you are forced to support other styles of signing at gunpoint, I suggest you ignore every siging scheme but his one. Demand your clients upgrade to recent browsers that support the latest Sun JVM. Here is the basic recipe for making your Applet work with Sun-style signing:
There are over a dozen different, incompatible Applet signing/security schemes.
Other ways to avoid signing are converting your Applets to applications by adding a main method. See Applet for how. This can be useful for debugging. Get the Applet working as an Application first, then worry about Appletness and signing later. Also consider Java Web Start as an alternative to Applets.
In contrast, a wild Applet is intended to be run by the general public without any special preparation such as installing a certificate or policy file. A wild Applet in one you might just stumble across in your web browsing. You don't know much about the author. The Applet might be signed, self-signed or unsigned. If there are any security decisions to me made, the browser asks the end user for permission each time the Applet is run, using technobabble.
Some security schemes are aimed at writing tame and others at writing wild Applets. Netscape and Internet Explorer schemes are primarily for wild Applets, where the Plug-in schemes are primarily for tame Applets.
Tame schemes typically use an ASCII policy text file that describes all the Applets, users and websites and what permissions each has. It is thus just about impossible for an individual Applet to automatically maintain. It is designed to be maintained by a network administrator who tightly controls just what can be run. The policy files can also control the activities of applications. Most people find it easier to compose the policy file with a text editor than using Sun's GUI policytool.
Tame schemes typically use a certificate file completely separate from the browser's list of root certificates. This is managed by keytool. Again certificates from all different Applets are merged in this file. This makes it almost impossible for an Applet to manage its certificates. The network administrator must compose and control this file.
| Scheme | Applet Type | Signing Tool | Certificate Type | Jar Type | Request Privilege | Notes |
|---|---|---|---|---|---|---|
| Netscape | tame | Netscape
signtool 1.3 |
self-signed RSA X.509 | jar | netscape.security.PrivilegeManager.enablePrivilege ("UniversalThreadAccess") | Netscape only. You must manually install the phony certificate in the client's Netscape browser. Fine grained control with capabilities. For debugging, you don't need any certificate real or phony; you can turning on codebase principles support. Note: Netscape and Sun RSA signing tools are not interchangeable. |
| Netscape | wild, tame | Netscape
signtool 1.3 |
Verisign or Thawte RSA X.509 | jar | netscape.security.PrivilegeManager.enablePrivilege ("UniversalThreadAccess") | Netscape only. There is no need to install the certificate on the client machine, so long as the browser comes pre-installed with the Verisign or Thawte RSA root certificate. Fine grained control with capabilities. Note: Netscape and Sun RSA signing tools are not interchangeable. |
| Microsoft Internet Explorer 5.5 | tame | signcode | self-signed Authenticode RSA X.509 | cab | com.ms.security.PolicyEngine.assertPermission (PermissionID.NETIO) | Internet Explorer only. You must manually install the phony certificate in the client's IE browser. It puts them in the registry under the entry HLM\Software\Microsoft\System Certificates. Fine grained control with PermissionIDs. |
| Microsoft Internet Explorer 5.5 | wild, tame | signcode | Verisign or Thawte Authenticode RSA X.509 | cab | com.ms.security.PolicyEngine.assertPermission (PermissionID.NETIO) | Internet Explorer only. There is no need to install the certificate on the client machine, so long as the browser comes pre-installed with the Verisign or Thawte Authenticode root certificate. Fine grained control with PermissionIDs. |
| Java Plug-in 1.1 | tame | Javakey | self-signed DSA | jar | Use Javakey to install the certificates in the identitydb.obj on the client machine. You would need a signed Applet to automate the install -- catch 22. | simple go-no-go. No granularity. In practice, users must manually install your certificate (as well as the Java Plug-in) before their browsers will recognize your signed Applet. |
| Java Plug-in 1.1 | tame | Javakey, jarsigner | Thawte Java 2 DSA X.509 cert delivered in a PKCS#7 wrapper. | jar | There is no need to install the certificate on the client's machine, so long as the browser comes pre-installed with the Thawte root DSA certificate. Use coarse grain permission only. | |
| Java Plug-in 1.2 | tame | Javakey, jarsigner | self-signed DSA | jar | Use keytool to install the public part of the certificate on the client's machine in the user-home directory as a .keystore file. Use coarse grain permissions, or optionally use policytool to create a policy file that lists the fine grained permissions required. Install that on the client's machine in the user-home directory. | |
| Java Plug-in 1.2 | tame | Javakey, jarsigner | Thawte Java 2 DSA X.509 cert delivered in a PKCS#7 wrapper. | jar | There is no need to install the certificate on the client's machine, so long as the browser comes pre-installed with the Thawte root DSA certificate. Use coarse grain permission or optionally Use policytool to create a policy file that lists the fine grained permissions required. Install that on the client's machine in the user-home directory. | |
| Java Plug-in 1.4, Netscape 7.02, Opera 7.21 | tame | Javakey, jarsigner | self-signed RSA | jar | Use keytool to install the public part of the certificate on the client's machine in the user-home directory as a .keystore file. Use coarse grain permissions, or optionally use policytool to create a policy file that lists the fine grained permissions required. Install that on the client's machine in the user-home directory. | |
| Java Plug-in 1.4, Netscape 7.02, Opera 7.21 | tame | Javakey, jarsigner | Thawte Java 2 RSA X.509 cert delivered in a PKCS#7 wrapper. | jar | There is no need to install the certificate on the client's machine, so long as the browser comes pre-installed with the Thawte root DSA certificate. Use coarse grain permission or optionally Use policytool to create a policy file that lists the fine grained permissions required. Install that on the client's machine in the user-home directory. | |
| Java Plug-in 1.4, Netscape 7.02, Opera 7.21 | tame | Netscape signtool 1.3 | Verisign or Thawte RSA X.509 | jar | There is no need to install the certificate on the client's machine, so long as the browser comes pre-installed with the Thawte root RSA certificate. There are problems with having the precise Verisign root certificates installed in Internet Explorer. See Verisign for details. Only coarse grain permission is available. The class files must contain no Netscape capabilities calls. | This allows Netscape jars, but not Netscape capabilities. Works in IE as well. Does not work in Opera with Verisign certificates since the root signing certificate is not provided, though the Thawte ones are. Note: Netscape and Sun RSA signing tools are not interchangeable. |
| Java Plug-in 1.4, Netscape 7.02, Opera 7.21 | ? | ? | ? | ? | Some sort of FIPS 140-1 process that does not use certificates. | |
| Apple MacIntosh MRJ | tame | Javakey | Verisign or Thawte RSA x.509 or DSA or self-signed | jar | You must always manually install the certificate in the browser. | Requires complex sign.directive text-form certificate that is not-integrated with the browser's list of certificates. JDK 1.1.8 compliant. Not supported in any browser yet, but supported in Netscape 5.0 and IE 5.0. You can test in the Mac AppletViewer. Supplanted by RSA in JDK 1.3+. |
The signing certificates are stored in a common file using keytool:
\WINNT\Profiles\Administrator\.keystore
On your clients, this would only need to contain your phony self-signed certificates. There would be no need to install your purchased signing certificates. You only need to install your signing certificates on your development machines where you sign your jar files. Of course, your phony certificates would also be installed in the keystore files of your development machines too.
The root certificate authority certificates are stored in:
\sdk1.4.2_02\jre\lib\security\cacerts
They are no longer stored in the browsers. You can add to the cacerts file with keytool using the password changeit.
Read about the enhancements over the 1.2 plug-in. trustProxyServer is now by default true, which means websites are no longer required to confirm their DNS name. The rules on matching of the jar signer with a root authority certificate have been relaxed. You can now preload Applets jars into lib/plugin.
In your Java code you also need to request permission for the various classes of sandbox security violations (sometimes called system targets, capabilities or privileges) that you require like this:
import netscape.security .PrivilegeManager; try { PrivilegeManager.enablePrivilege( "UniversalConnect" ); } catch ( netscape .security.ForbiddenTargetException e ) { }
The permission only lasts until the method that requested permission exits. It persists automatically in methods you call. Happily when you ask a second time for permission, the security manager will not pester the user with a dialog box.
Make sure your compile-time classpath includes the Netscape security classes in:
\program files\netscape\communicator\program\java\classes\java40.jar.
Netscape will automatically provide these classes at run time. Don't put them in your jar.
You must also add a special line to your APPLET invocation HTML:
archive="myapp.jar"
Netscape Security Capabilities 2004-06-28
<param name="cabbase" value="myapp.cab">
There are circumstances when you do need to put permission asking code in your Applet. See this discussion. IE drives me nuts just to install, so I have done all I could to avoid playing with its brain damaged Java and signing scheme. Sorry I can't be more help here.
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 43388. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/signedapplets.html | J:\mindprod\jgloss\signedapplets.html | |||