Name

Class javax.security.auth.Subject

Synopsis

Subjects represent the state of an authenticated user. The user may have a set of public and/or private credentials, as well as other principal information. They are generally returned from the LoginContext class.

The doAs( ) methods of this class allow the target code to be run with permission checking to ensure the target subject has been granted the appropriate permissions.

Class Definition

public final class javax.security.auth.Subject
    extends java.lang.Object
    implements java.io.Serializable {

    // Constructors
    public Subject(  );
    public Subject(boolean, Set, Set, Set);

    // Class Methods
    public static Object doAs(Subject, PrivilegedExceptionAction);
    public static Object doAs(Subject, PrivilegedAction);
    public static Object doAsPrivileged(Subject,
                             PrivilegedAction, AccessControlContext);
    public static Object doAsPrivileged(Subject,
                     PrivilegedExceptionAction, AccessControlContext);
    public static Subject getSubject(AccessControlContext);

    // Instance Methods
    public boolean equals(Object);
    public Set getPrincipals(  );
    public Set getPrincipals(Class);
    public Set getPrivateCredentials(Class);
    public Set getPrivateCredentials(  );
    public Set getPublicCredentials(  );
    public Set getPublicCredentials(Class);
    public int hashCode(  );
    public boolean isReadOnly(  );
    public void setReadOnly(  );
    public String toString(  );
}

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.