Permissions

Every Java class carries a set of permissions that defines the activities that the class is allowed to perform. The parameters of the sandbox are wholly defined by these permissions. When a Java program attempts to perform a sensitive operation, the permissions for all active classes are consulted: if every class carries the permission to perform the operation, then the operation is permitted to continue. Otherwise, an exception is thrown in the code, and the operation fails.

Classes that make up the core Java API are always given permission to perform any action. All other classes, including those on the classpath, must explicitly be given permission to perform sensitive operations. For the most part, these permissions are listed in various policy files, along with the code source to which they apply. End users and system administrators define the parameters of the sandbox by administering these policy files.

The permissions within the virtual ...

Get Java Security, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.