O'Reilly logo

Java Security, 2nd Edition by Scott Oaks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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(  );
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required