java.awt
Class AWTPermission

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.Permission sample code for java.security.Permission definition code for java.security.Permission 
      extended by java.security.BasicPermission sample code for java.security.BasicPermission definition code for java.security.BasicPermission 
          extended by java.awt.AWTPermission
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Guard sample code for java.security.Guard definition code for java.security.Guard

public final class AWTPermission
extends BasicPermission sample code for java.security.BasicPermission definition code for java.security.BasicPermission

This class is for AWT permissions. An AWTPermission contains a target name but no actions list; you either have the named permission or you don't.

The target name is the name of the AWT permission (see below). The naming convention follows the hierarchical property naming convention. Also, an asterisk could be used to represent all AWT permissions.

The following table lists all the possible AWTPermission target names, and for each provides a description of what the permission allows and a discussion of the risks of granting code the permission.

Permission Target Name What the Permission Allows Risks of Allowing this Permission
accessClipboard Posting and retrieval of information to and from the AWT clipboard This would allow malfeasant code to share potentially sensitive or confidential information.
accessEventQueue Access to the AWT event queue After retrieving the AWT event queue, malicious code may peek at and even remove existing events from its event queue, as well as post bogus events which may purposefully cause the application or applet to misbehave in an insecure manner.
createRobot Create java.awt.Robot objects The java.awt.Robot object allows code to generate native-level mouse and keyboard events as well as read the screen. It could allow malicious code to control the system, run other programs, read the display, and deny mouse and keyboard access to the user.
fullScreenExclusive Enter full-screen exclusive mode Entering full-screen exclusive mode allows direct access to low-level graphics card memory. This could be used to spoof the system, since the program is in direct control of rendering.
listenToAllAWTEvents Listen to all AWT events, system-wide After adding an AWT event listener, malicious code may scan all AWT events dispatched in the system, allowing it to read all user input (such as passwords). Each AWT event listener is called from within the context of that event queue's EventDispatchThread, so if the accessEventQueue permission is also enabled, malicious code could modify the contents of AWT event queues system-wide, causing the application or applet to misbehave in an insecure manner.
readDisplayPixels Readback of pixels from the display screen Interfaces such as the java.awt.Composite interface or the java.awt.Robot class allow arbitrary code to examine pixels on the display enable malicious code to snoop on the activities of the user.
replaceKeyboardFocusManager Sets the KeyboardFocusManager for a particular thread. When SecurityManager is installed, the invoking thread must be granted this permission in order to replace the current KeyboardFocusManager. If permission is not granted, a SecurityException will be thrown.
showWindowWithoutWarningBanner Display of a window without also displaying a banner warning that the window was created by an applet Without this warning, an applet may pop up windows without the user knowing that they belong to an applet. Since users may make security-sensitive decisions based on whether or not the window belongs to an applet (entering a username and password into a dialog box, for example), disabling this warning banner may allow applets to trick the user into entering such information.
watchMousePointer Getting the information about the mouse pointer position at any time Constantly watching the mouse pointer, an applet can make guesses about what the user is doing, i.e. moving the mouse to the lower left corner of the screen most likely means that the user is about to launch an application. If a virtual keypad is used so that keyboard is emulated using the mouse, an applet may guess what is being typed.
setWindowAlwaysOnTop Setting always-on-top property of the window: Window.setAlwaysOnTop(boolean) sample code for java.awt.Window.setAlwaysOnTop(boolean) definition code for java.awt.Window.setAlwaysOnTop(boolean) The malicious window might make itself look and behave like a real full desktop, so that information entered by the unsuspecting user is captured and subsequently misused
setAppletStub Setting the stub which implements Applet container services Malicious code could set an applet's stub and result in unexpected behavior or denial of service to an applet.

See Also:
BasicPermission sample code for java.security.BasicPermission definition code for java.security.BasicPermission , Permission sample code for java.security.Permission definition code for java.security.Permission , Permissions sample code for java.security.Permissions definition code for java.security.Permissions , PermissionCollection sample code for java.security.PermissionCollection definition code for java.security.PermissionCollection , SecurityManager sample code for java.lang.SecurityManager definition code for java.lang.SecurityManager , Serialized Form

Constructor Summary
AWTPermission sample code for java.awt.AWTPermission.AWTPermission(java.lang.String) definition code for java.awt.AWTPermission.AWTPermission(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Creates a new AWTPermission with the specified name.
AWTPermission sample code for java.awt.AWTPermission.AWTPermission(java.lang.String, java.lang.String) definition code for java.awt.AWTPermission.AWTPermission(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name, String sample code for java.lang.String definition code for java.lang.String  actions)
          Creates a new AWTPermission object with the specified name.
 
Method Summary
 
Methods inherited from class java.security.BasicPermission sample code for java.security.BasicPermission definition code for java.security.BasicPermission
equals sample code for java.security.BasicPermission.equals(java.lang.Object) definition code for java.security.BasicPermission.equals(java.lang.Object) , getActions sample code for java.security.BasicPermission.getActions() definition code for java.security.BasicPermission.getActions() , hashCode sample code for java.security.BasicPermission.hashCode() definition code for java.security.BasicPermission.hashCode() , implies sample code for java.security.BasicPermission.implies(java.security.Permission) definition code for java.security.BasicPermission.implies(java.security.Permission) , newPermissionCollection sample code for java.security.BasicPermission.newPermissionCollection() definition code for java.security.BasicPermission.newPermissionCollection()
 
Methods inherited from class java.security.Permission sample code for java.security.Permission definition code for java.security.Permission
checkGuard sample code for java.security.Permission.checkGuard(java.lang.Object) definition code for java.security.Permission.checkGuard(java.lang.Object) , getName sample code for java.security.Permission.getName() definition code for java.security.Permission.getName() , toString sample code for java.security.Permission.toString() definition code for java.security.Permission.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

AWTPermission sample code for java.awt.AWTPermission(java.lang.String) definition code for java.awt.AWTPermission(java.lang.String)

public AWTPermission(String sample code for java.lang.String definition code for java.lang.String  name)
Creates a new AWTPermission with the specified name. The name is the symbolic name of the AWTPermission, such as "topLevelWindow", "systemClipboard", etc. An asterisk may be used to indicate all AWT permissions.

Parameters:
name - the name of the AWTPermission

AWTPermission sample code for java.awt.AWTPermission(java.lang.String, java.lang.String) definition code for java.awt.AWTPermission(java.lang.String, java.lang.String)

public AWTPermission(String sample code for java.lang.String definition code for java.lang.String  name,
                     String sample code for java.lang.String definition code for java.lang.String  actions)
Creates a new AWTPermission object with the specified name. The name is the symbolic name of the AWTPermission, and the actions string is currently unused and should be null.

Parameters:
name - the name of the AWTPermission
actions - should be null