| Package | Description | 
|---|---|
| java.security | Provides the classes and interfaces for the security framework. | 
| javax.security.auth | This package provides a framework for authentication and
 authorization. | 
| Modifier and Type | Method and Description | 
|---|---|
| static <T> T | AccessController. doPrivileged(PrivilegedExceptionAction<T> action)Performs the specified  PrivilegedExceptionActionwith
 privileges enabled. | 
| static <T> T | AccessController. doPrivileged(PrivilegedExceptionAction<T> action,
            AccessControlContext context)Performs the specified  PrivilegedExceptionActionwith
 privileges enabled and restricted by the specifiedAccessControlContext. | 
| static <T> T | AccessController. doPrivileged(PrivilegedExceptionAction<T> action,
            AccessControlContext context,
            Permission... perms)Performs the specified  PrivilegedExceptionActionwith
 privileges enabled and restricted by the specifiedAccessControlContextand with a privilege scope limited by
 specifiedPermissionarguments. | 
| static <T> T | AccessController. doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action)Performs the specified  PrivilegedExceptionActionwith
 privileges enabled. | 
| static <T> T | AccessController. doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action,
                        AccessControlContext context,
                        Permission... perms)Performs the specified  PrivilegedExceptionActionwith
 privileges enabled and restricted by the specifiedAccessControlContextand with a privilege scope limited by
 specifiedPermissionarguments. | 
| Modifier and Type | Method and Description | 
|---|---|
| static <T> T | Subject. doAs(Subject subject,
    PrivilegedExceptionAction<T> action)Perform work as a particular  Subject. | 
| static <T> T | Subject. doAsPrivileged(Subject subject,
              PrivilegedExceptionAction<T> action,
              AccessControlContext acc)Perform privileged work as a particular  Subject. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.