Trusted and Untrusted Classes
In the discussion that follows, we make the distinction between trusted and untrusted classes. Generally, an implementation of a security manager allows more operations for trusted classes than for untrusted classes. Whether or not a class is trusted is a complex decision based upon many factors—not the least of which is the release of Java under which the program is running. The default notion of what constitutes a trusted class has changed significantly between releases of Java:
In Java 1.0, a class that is loaded from the
CLASSPATHis considered trusted, and a class that is loaded from a class loader is considered untrusted.In Java 1.1, that same rule applies, but a class that is loaded from a JAR file may carry with it a digital signature that allows it to be given extra privileges.
In Java 1.2, a class that is loaded from the core API is considered trusted and may perform any operation it wants to. Otherwise, classes are (by default) given privileges based upon where they were loaded from, including if they were loaded from the
CLASSPATH. However, this applies only when certain command-line arguments are present; in the default method of loading applications, items from theCLASSPATHare generally considered trusted.
Nothing inherent in the design of the security manager requires security to be enforced as an all-or-nothing proposition for each class. It’s possible to write a security manager that gives access to certain parts of the filesystem ...