Java Reference
In-Depth Information
Security Permission
Description
Access
Clipboard
java.awt.AWTPermission
Access
EventQueue
java.awt.AWTPermission
Show
WindowWithoutWarningBanner
java.awt.AWTPermission
Access
System.exit
java.lang.RuntimePermission
Access
loadLibrary
java.lang.RuntimePermission
Access
queuePrintJob
java.lang.RuntimePermission
Connect
java.net.SocketPermission
Listen, accept from
localhost:1024
java.net.SocketPermission
For more information on this level of security, consult the J2EE specification documentation.
A Class Testing JNLP Security
The
SecurityTester
class allows the user to launch any of the runtime services with different
security levels. It is also a first example of how to use JNLP runtime services. We will see
them in detail in Chapter 11, “Runtime Client Services.”
In Listing 10.7, you see the JNLP file for the
all-permissions
modality.
L
ISTING
10.7
JNLP File for Launching the Security Testing Application With All-
Permissions
<?xml version=”1.0” encoding=”utf-8”?>
<jnlp spec=”1.0+”
codebase=”http://server/b2/c10/”>
<information>
<title>A Security Test</title>
<vendor>Mauro Inc.</vendor>
<description>A Security Test</description>
<offline-allowed/>
</information>
<security><all-permissions/></security>
<resources>
<j2se version=”1.3+”/>
<jar href=”sec-test.jar”/>
</resources>
<application-desc main-class=”com.marinilli.b2.c10.SecurityTester”/>
</jnlp>
Changing the kind of permissions while still launching the same application will show the dif-
ferences in the three security modalities.
A screenshot of the little testing program at work is given in Figure 10.3.