| java.lang.Object | |
| ↳ | javax.security.auth.Subject |
The central class of the javax.security.auth package representing an
authenticated user or entity (both referred to as "subject"). IT defines also
the static methods that allow code to be run, and do modifications according
to the subject's permissions.
A subject has the following features:
Principal objects specifying the identities bound to a
Subject that distinguish it.| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
The default constructor initializing the sets of public and private
credentials and principals with the empty set.
| |||||||||||
The constructor for the subject, setting its public and private
credentials and principals according to the arguments.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Runs the code defined by
action using the permissions granted to
the Subject itself and to the code as well. | |||||||||||
Runs the code defined by
action using the permissions granted to
the subject and to the code itself. | |||||||||||
Run the code defined by
action using the permissions granted to
the Subject and to the code itself, additionally providing a more
specific context. | |||||||||||
Runs the code defined by
action using the permissions granted to
the subject and to the code itself, additionally providing a more
specific context. | |||||||||||
Checks two Subjects for equality.
| |||||||||||
Returns this
Subject's Principal. | |||||||||||
Returns this
Subject's private credentials which are a subclass
of the Class provided. | |||||||||||
Returns the private credentials associated with this
Subject. | |||||||||||
Returns this
Subject's public credentials which are a subclass of
the Class provided. | |||||||||||
Returns the public credentials associated with this
Subject. | |||||||||||
Returns the
Subject that was last associated with the context provided as argument. | |||||||||||
Returns a hash code of this
Subject. | |||||||||||
Returns whether this
Subject is read-only or not. | |||||||||||
Prevents from modifications being done to the credentials and
Principal sets. | |||||||||||
Returns a
String representation of this Subject. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
The default constructor initializing the sets of public and private credentials and principals with the empty set.
The constructor for the subject, setting its public and private credentials and principals according to the arguments.
| readOnly | true if this Subject is read-only, thus
preventing any modifications to be done. |
|---|---|
| subjPrincipals | the set of Principals that are attributed to this Subject. |
| pubCredentials | the set of public credentials that distinguish this Subject. |
| privCredentials | the set of private credentials that distinguish this Subject.
|
Runs the code defined by action using the permissions granted to
the Subject itself and to the code as well.
| subject | the distinguished Subject. |
|---|---|
| action | the code to be run. |
Object returned when running the action.
Runs the code defined by action using the permissions granted to
the subject and to the code itself.
| subject | the distinguished Subject. |
|---|---|
| action | the code to be run. |
Object returned when running the action.| PrivilegedActionException | if running the action throws an exception.
|
|---|
Run the code defined by action using the permissions granted to
the Subject and to the code itself, additionally providing a more
specific context.
| subject | the distinguished Subject. |
|---|---|
| action | the code to be run. |
| context | the specific context in which the action is invoked.
if null a new AccessControlContext is
instantiated. |
Object returned when running the action.
Runs the code defined by action using the permissions granted to
the subject and to the code itself, additionally providing a more
specific context.
| subject | the distinguished Subject. |
|---|---|
| action | the code to be run. |
| context | the specific context in which the action is invoked.
if null a new AccessControlContext is
instantiated. |
Object returned when running the action.| PrivilegedActionException | if running the action throws an exception.
|
|---|
Checks two Subjects for equality. More specifically if the principals,
public and private credentials are equal, equality for two Subjects is implied.
| obj | the Object checked for equality with this Subject. |
|---|
true if the specified Subject is equal to this
one.
Returns this Subject's private credentials which are a subclass
of the Class provided.
| c | the Class as a criteria which the private credentials
returned must satisfy. |
|---|
Subject's private credentials. Modifications to the
returned set of credentials do not affect this Subject's
credentials.
Returns the private credentials associated with this Subject.
Subject.
Returns this Subject's public credentials which are a subclass of
the Class provided.
| c | the Class as a criteria which the public credentials
returned must satisfy. |
|---|
Subject's public credentials. Modifications to the
returned set of credentials do not affect this Subject's
credentials.
Returns the public credentials associated with this Subject.
Subject.
Returns the Subject that was last associated with the context provided as argument.
| context | the context that was associated with the
Subject. |
|---|
Subject that was last associated with the context provided as argument.
Returns a hash code of this Subject.
Subject.
Returns whether this Subject is read-only or not.
Subject is read-only or not.
Prevents from modifications being done to the credentials and Principal sets. After setting it to read-only this Subject can
not be made writable again. The destroy method on the credentials still
works though.
Returns a String representation of this Subject.
String representation of this Subject.