|
A number of Java 2 platform methods are implemented to verify access permissions. This means that before they execute, they verify that there is a system, user, or program has a policy file with the required permissions for execution to continue. If no such permission is found, execution stops with an error condition.
The access verification code passes the required permissions to the
security manager, and the security manager
checks that permission against the policy file permissions to determine
whether to access. This means that Java 2 platform API methods are associated
with specific permissions, and specific permissions are associated with specific
This appendix lists the Java 2 platform methods, the permission associated
with each method, and the
java.awt.Graphics2D public abstract void setComposite(Composite comp) java.Security.SecurityManager.checkPermission java.awt.AWTPermission "readDisplayPixels" The access verification code for setComposite should call java.Security.SecurityManager.checkPermission and pass it java.awt.AWTPermission "readDisplayPixels" when a Graphics2D context draws to a Component on the display screen and the Composite is a custom object rather than an AlphaComposite object. java.awt.Toolkit
~~~~~~~~~
~~~~~~~~~
public abstract Clipboard getSystemClipboard() checkSystemClipboardAccess java.awt.AWTPermission "accessClipboard" ~~~~~~~~~
public final EventQueue getSystemEventQueue() checkAwtEventQueueAccess java.awt.AWTPermission "accessEventQueue"java.awt.Window
Window() checkTopLevelWindow java.awt.AWTPermission "showWindowWithoutWarningBanner"java.beans.Beans
java.beans.Introspector
public static synchronized void setBeanInfoSearchPath(String path[]) checkPropertiesAccess java.util.PropertyPermissions "*", "read,write"java.beans.PropertyEditorManager
java.io.File
public boolean delete()
public void deleteOnExit()
checkDelete(String)
java.io.FilePermission "{name}", "delete"
~~~~~~~~~
~~~~~~~~~
java.io.FileInputStream
FileInputStream(FileDescriptor fdObj) checkRead(FileDescriptor) java.lang.RuntimePermission "readFileDescriptor" ~~~~~~~~~
FileInputStream(String name)
FileInputStream(File file)
checkRead(String)
java.io.FilePermission "{name}", "read"
java.io.FileOutputStream
FileOutputStream(FileDescriptor fdObj) checkWrite(FileDescriptor) java.lang.RuntimePermission "writeFileDescriptor" ~~~~~~~~~
java.io.ObjectInputStream
~~~~~~~~~
java.io.ObjectOutputStream
java.io.RandomAccessFile
RandomAccessFile(String name, String mode)
RandomAccessFile(File file, String mode)
checkRead(String)
java.io.FilePermission "{name}", "read"
In both these methods the mode is r.
~~~~~~~~~
RandomAccessFile(String name, String mode)
checkRead(String) and checkWrite(String)
java.io.FilePermission "{name}", "read,write"
In this method the mode is rw.
~~~~~~~~~
java.lang.Class
The access verification code for this method calls checkPermission and pass it
java.lang.RuntimePermission("getClassLoader")
when loader is null and
the caller's class loader is not null.
~~~~~~~~~
The access verification code for this class and each of its superclasses calls checkMemberAccess(this, Member.DECLARED).
If the class is in a package, checkPackageAccess({pkgName}) is
also called. By default, checkMemberAccess
does not require permission if this class's classloader is
the same as that of the caller. Otherwise, it
requires java.lang.RuntimePermission "accessDeclaredMembers".
If the class is in a package,
java.lang.RuntimePermission "accessClassInPackage.{pkgName}"
is also required.
~~~~~~~~~
public ClassLoader getClassLoader() checkPermission java.lang.RuntimePermission "getClassLoader"If the caller's class loader is null, or is the same as or
an ancestor of the class loader for the class whose class loader is being
requested, no permission is needed. Otherwise,
java.lang.RuntimePermission "getClassLoader"
is required.
~~~~~~~~~
If Class is in a package, the access verification code
should call checkPackageAccess({pkgName}) and pass it
java.lang.RuntimePermission "accessClassInPackage.{pkgName}.
If ~~~~~~~~~
If Class is not in a package, the access verification
code for these methods calls
checkMemberAccess(this, Member.PUBLIC),
but no permission is passed.
If ~~~~~~~~~
public ProtectionDomain getProtectionDomain() checkPermission java.lang.RuntimePermission "getProtectionDomain"java.lang.ClassLoader
ClassLoader() ClassLoader(ClassLoader parent) checkCreateClassLoader java.lang.RuntimePermission "createClassLoader" ~~~~~~~~~
If the caller's class loader is null or is the same as or an
ancestor of the class loader for the class whose class loader is being
requested, no permission is needed. Otherwise,
java.lang.RuntimePermission "getClassLoader" is required.
java.lang.Runtime
~~~~~~~~~
~~~~~~~~~
In these methods {libName} is the lib,
filename or libname argument.
java.lang.SecurityManager
<all methods> checkPermission See Security Manager Methods.java.lang.System
~~~~~~~~~
In these methods {libName} is the lib,
filename or libname argument.
~~~~~~~~~
public static Properties getProperties() public static void setProperties(Properties props) checkPropertiesAccess java.util.PropertyPermission "*", "read,write" ~~~~~~~~~
~~~~~~~~~
~~~~~~~~~
public static String setProperty(String key,
String value)
checkPermission
java.util.PropertyPermission "{key}", "write"
~~~~~~~~~
public static synchronized void
setSecurityManager(SecurityManager s)
checkPermission
java.lang.RuntimePermission "setSecurityManager"
java.lang.Thread
public ClassLoader getContextClassLoader() checkPermission java.lang.RuntimePermission "getClassLoader"If the caller's class loader is null or is the same
as or an ancestor of the context class loader for the thread whose
context class loader is being requested, no permission is needed.
Otherwise, java.lang.RuntimePermission "getClassLoader"
is required.
~~~~~~~~~
~~~~~~~~~
~~~~~~~~~
public static int
enumerate(Thread tarray[])
checkAccess({threadGroup})
java.lang.RuntimePermission "modifyThreadGroup"
~~~~~~~~~
The access verification code should call checkAccess
and pass it java.lang.RuntimePermission "modifyThread", unless
the current thread is trying to stop a thread other than itself.
In this case, the access verification code should call
checkPermission and pass it
java.lang.RuntimePermission "stopThread".
~~~~~~~~~
The access verification code should call checkAccess
and pass it java.lang.RuntimePermission "modifyThread"
unless the current thread is trying to stop a thread other than itself
or obj is not an instance of ThreadDeath. In
this case, the access verification code should call
checkPermission and pass it
java.lang.RuntimePermission "stopThread".
~~~~~~~~~
~~~~~~~~~
Thread(ThreadGroup group, ...) checkAccess(this) for ThreadGroup methods, or checkAccess(group) for Thread methods java.lang.RuntimePermission "modifyThreadGroup"java.lang.ThreadGroup
~~~~~~~~~
~~~~~~~~~
public final void interrupt() checkAccess(this) java.lang.RuntimePermission "modifyThreadGroup" java.lang.RuntimePermission "modifyThread"The access verification code for this method also requires java.lang.RuntimePermission "modifyThread"
because the java.lang.Thread interrupt() method
is called for each thread in the thread group and in all of its subgroups.
~~~~~~~~~
The access verification code for this method also requires java.lang.RuntimePermission "modifyThread" and possibly
java.lang.RuntimePermission "stopThread" because
the java.lang.Thread stop() method
is called for each thread in the thread group and in all of its subgroups.
java.lang.reflect.AccessibleObject
java.net.Authenticator
~~~~~~~~~
public static void setDefault(Authenticator a) checkPermission java.net.NetPermission "setDefaultAuthenticator"java.net.DatagramSocket
The access verification code for send
calls checkMulticast in the following case:
The access verification code for send calls
checkConnect in the following case:
~~~~~~~~~
public InetAddress getLocalAddress()
checkConnect({host}, -1)
java.net.SocketPermission "{host}", "resolve"
~~~~~~~~~
DatagramSocket(...)
checkListen({port})
The access verification code for this method calls
checkListen and passes in socket permissions
as follows:
~~~~~~~~~
public synchronized void receive(DatagramPacket p)
checkAccept({host}, {port})
java.net.SocketPermission "{host}:{port}",
"accept"
java.net.HttpURLConnection
public static void setFollowRedirects(boolean set) checkSetFactory java.lang.RuntimePermission "setFactory"java.net.InetAddress
java.net.MulticastSocket
~~~~~~~~~
The access verification code for send
calls checkMulticast in the following case:
The access verification code for this method calls checkConnect in the following case:
~~~~~~~~~
MulticastSocket(...)
checkListen({port})
The access verification code for this method
calls checkListen in the following case:
java.net.ServerSocket
ServerSocket(...)
checkListen({port})
The access verification code for this method
calls checkListen in the following case:
~~~~~~~~~
~~~~~~~~~
public static synchronized void setSocketFactory(...) checkSetFactory java.lang.RuntimePermission "setFactory"java.net.Socket
public static synchronized void setSocketImplFactory(...) checkSetFactory java.lang.RuntimePermission "setFactory" ~~~~~~~~~
Socket(...)
checkConnect({host}, {port})
java.net.SocketPermission
"{host}:{port}", "connect"
java.net.URL
public static synchronized void setURLStreamHandlerFactory(...) checkSetFactory java.lang.RuntimePermission "setFactory" ~~~~~~~~~
URL(...) checkPermission java.net.NetPermission "specifyStreamHandler"java.net.URLConnection
java.net.URLClassLoader
URLClassLoader(...) checkCreateClassLoader java.lang.RuntimePermission "createClassLoader"java.rmi.activation.ActivationGroup
java.rmi.server.RMISocketFactory
public synchronized static void setSocketFactory(...) checkSetFactory java.lang.RuntimePermission "setFactory"java.security.Identity
public void addCertificate(...)
checkSecurityAccess("addIdentityCertificate")
java.security.SecurityPermission
"addIdentityCertificate"
~~~~~~~~~
public void removeCertificate(...)
checkSecurityAccess("removeIdentityCertificate")
java.security.SecurityPermission
"removeIdentityCertificate"
~~~~~~~~~
public void setInfo(String info)
checkSecurityAccess("setIdentityInfo")
java.security.SecurityPermission
"setIdentityInfo"
~~~~~~~~~
public void setPublicKey(PublicKey key)
checkSecurityAccess("setIdentityPublicKey")
java.security.SecurityPermission
"setIdentityPublicKey"
~~~~~~~~~
public String toString(...)
checkSecurityAccess("printIdentity")
java.security.SecurityPermission
"printIdentity"
java.security.IdentityScope
protected static void setSystemScope()
checkSecurityAccess("setSystemScope")
java.security.SecurityPermission
"setSystemScope"
java.security.Permission
public void checkGuard(Object object) checkPermission(this)This Permission object is the permission checked. java.security.Policy
public static Policy getPolicy() checkPermission java.security.SecurityPermission "getPolicy" ~~~~~~~~~
public static void setPolicy(Policy policy); checkPermission java.security.SecurityPermission "setPolicy" ~~~~~~~~~
java.security.Provider
In this method name is the provider name. ~~~~~~~~~
In this method name is the provider name. ~~~~~~~~~
In this method name is the provider name. java.security.SecureClassLoader
SecureClassLoader(...) checkCreateClassLoader java.lang.RuntimePermission "createClassLoader"java.security.Security
public static void getProperty(String key)
checkPermission
java.security.SecurityPermission "getProperty.{key}"
~~~~~~~~~
~~~~~~~~~
public static void removeProvider(String name)
checkSecurityAccess("removeProvider."+name)
java.security.SecurityPermission "removeProvider.{name}"
~~~~~~~~~
java.security.Signer
public PrivateKey getPrivateKey()
checkSecurityAccess("getSignerPrivateKey")
java.security.SecurityPermission
"getSignerPrivateKey"
~~~~~~~~~
public final void setKeyPair(KeyPair pair)
checkSecurityAccess("setSignerKeypair")
java.security.SecurityPermission
"setSignerKeypair"
java.util.Locale
java.util.zip.ZipFile
ZipFile(String name)
checkRead
java.io.FilePermission "{name}","read"
[TOP] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||