The type of a class is a
combination of the fully qualified class name
and the defining class loader. That is to
say that two classes with the same fully qualified
name but which are defined by different instances
of a class loader are NOT of the same type.
However, execution of malicious code is generally
thwarted by the bytecode verifier, and NOT
necessarily the type safety mechanism of the
Java language.
Signed classes are NOT implicitly granted
full access, but rather permissions are assigned
to code based on its various characteristics,
including whether or not it is signed and
if so, by whom. In an applet container, such
as the Java Plugin, the user may be prompted
when a signed applet is being loaded, to grant
the signed code all permission.
The principle role of a TrustManager is to determine if presented authentication
credentials should be trusted.