Overview
Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
Sample
Document
Class java.awt.AWTPermission
Inherited members: ShowHide
Deprecated: ShowHide
View: ClientSubclassPackageImplementation
java.awt

Class AWTPermission

  • java.lang.Object
    • java.security.Permission
      • java.security.BasicPermission
        • java.awt.AWTPermission
  • All Implemented Interfaces:
    java.io.Serializable, java.security.Guard
    public final class AWTPermission extends 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.
    accessSystemTray Access to the AWT SystemTray instance This would allow malicious code to add tray icons to the system tray. First, such an icon may look like the icon of some known application (such as a firewall or anti-virus) and order a user to do something unsafe (with help of balloon messages). Second, the system tray may be glutted with tray icons so that no one could add a tray icon anymore.
    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. Depending on the implementation, the security warning may not be shown for the windows used to enter the full-screen exclusive mode (assuming that the fullScreenExclusive permission has been granted to this application). Note that this behavior does not mean that the showWindowWithoutWarningBanner permission will be automatically granted to the application which has the fullScreenExclusive permission: non-full-screen windows will continue to be shown with the security warning.
    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.
    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.
    setWindowAlwaysOnTop Setting always-on-top property of the window: 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
    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.
    toolkitModality Creating TOOLKIT_MODAL dialogs and setting the TOOLKIT_EXCLUDE window property. When a toolkit-modal dialog is shown from an applet, it blocks all other applets in the browser. When launching applications from Java Web Start, its windows (such as the security dialog) may also be blocked by toolkit-modal dialogs, shown from these applications.
    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.
    See Also:
    BasicPermission, Permission, Permissions, PermissionCollection, SecurityManager, Serialized Form
    • Constructors 
      Constructor and Description
      Ordinary member indicator AWTPermission Reveal DetailHide Detail
      AWTPermission(java.lang.String name)
      Creates a new AWTPermission with the specified name.
      public AWTPermission(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
      Throws:
      java.lang.NullPointerException - if name is null.
      java.lang.IllegalArgumentException - if name is empty.
      Ordinary member indicator AWTPermission Reveal DetailHide Detail
      AWTPermission(java.lang.String name, java.lang.String actions)
      Creates a new AWTPermission object with the specified name.
      public AWTPermission(java.lang.String name, 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
      Throws:
      java.lang.NullPointerException - if name is null.
      java.lang.IllegalArgumentException - if name is empty.
    • Methods 
      Modifier and Type Method and Description
      Inherited member indicator checkGuard Reveal DetailHide Detail
      void checkGuard(java.lang.Object object)
      Implements the guard interface for a permission.
      public void checkGuard(java.lang.Object object) throws java.lang.SecurityException
      Description copied from class: java.security.Permission
      Implements the guard interface for a permission. The SecurityManager.checkPermission method is called, passing this permission object as the permission to check. Returns silently if access is granted. Otherwise, throws a SecurityException.
      Specified by:
      checkGuard in interface java.security.Guard
      Parameters:
      object - the object being guarded (currently ignored).
      Throws:
      java.lang.SecurityException - if a security manager exists and its checkPermission method doesn't allow access.
      See Also:
      Guard, GuardedObject, SecurityManager.checkPermission(java.security.Permission)
      Inherited member indicator equals Reveal DetailHide Detail
      boolean equals(java.lang.Object obj)
      Checks two BasicPermission objects for equality.
      public boolean equals(java.lang.Object obj)
      Description copied from class: java.security.BasicPermission
      Checks two BasicPermission objects for equality. Checks that obj's class is the same as this object's class and has the same name as this object.

      Specified by:
      equals in class java.security.Permission
      Parameters:
      obj - the object we are testing for equality with this object.
      Returns:
      true if obj's class is the same as this object's class and has the same name as this BasicPermission object, false otherwise.
      See Also:
      Object.hashCode(), HashMap
      Inherited member indicator getActions Reveal DetailHide Detail
      java.lang.String getActions()
      Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for a BasicPermission.
      public java.lang.String getActions()
      Description copied from class: java.security.BasicPermission
      Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for a BasicPermission.
      Specified by:
      getActions in class java.security.Permission
      Returns:
      the empty string "".
      Inherited member indicator getName Reveal DetailHide Detail
      java.lang.String getName()
      Returns the name of this Permission.
      public final java.lang.String getName()
      Description copied from class: java.security.Permission
      Returns the name of this Permission. For example, in the case of a java.io.FilePermission, the name will be a pathname.
      Returns:
      the name of this Permission.
      Inherited member indicator hashCode Reveal DetailHide Detail
      int hashCode()
      Returns the hash code value for this object.
      public int hashCode()
      Description copied from class: java.security.BasicPermission
      Returns the hash code value for this object. The hash code used is the hash code of the name, that is, getName().hashCode(), where getName is from the Permission superclass.
      Specified by:
      hashCode in class java.security.Permission
      Returns:
      a hash code value for this object.
      See Also:
      Object.equals(java.lang.Object), System.identityHashCode(java.lang.Object)
      Inherited member indicator implies Reveal DetailHide Detail
      boolean implies(java.security.Permission p)
      Checks if the specified permission is "implied" by this object.
      public boolean implies(java.security.Permission p)
      Description copied from class: java.security.BasicPermission
      Checks if the specified permission is "implied" by this object.

      More specifically, this method returns true if:

      • p's class is the same as this object's class, and

      • p's name equals or (in the case of wildcards) is implied by this object's name. For example, "a.b.*" implies "a.b.c".
      Specified by:
      implies in class java.security.Permission
      Parameters:
      p - the permission to check against.
      Returns:
      true if the passed permission is equal to or implied by this permission, false otherwise.
      Inherited member indicator newPermissionCollection Reveal DetailHide Detail
      java.security.PermissionCollection newPermissionCollection()
      Returns a new PermissionCollection object for storing BasicPermission objects.
      public java.security.PermissionCollection newPermissionCollection()
      Description copied from class: java.security.BasicPermission
      Returns a new PermissionCollection object for storing BasicPermission objects.

      BasicPermission objects must be stored in a manner that allows them to be inserted in any order, but that also enables the PermissionCollection implies method to be implemented in an efficient (and consistent) manner.

      Overrides:
      newPermissionCollection in class java.security.Permission
      Returns:
      a new PermissionCollection object suitable for storing BasicPermissions.
      Inherited member indicator toString Reveal DetailHide Detail
      java.lang.String toString()
      Returns a string describing this Permission.
      public java.lang.String toString()
      Description copied from class: java.security.Permission
      Returns a string describing this Permission. The convention is to specify the class name, the permission name, and the actions in the following format: '("ClassName" "name" "actions")', or '("ClassName" "name")' if actions list is null or empty.
      Overrides:
      toString in class java.lang.Object
      Returns:
      information about this Permission.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge