java.lang.Object | ||
↳ | java.security.Permission | |
↳ | javax.security.auth.PrivateCredentialPermission |
Protects private credential objects belonging to a Subject
. It has
only one action which is "read". The target name of this permission has a
special syntax:
targetName = CredentialClass {PrincipalClass "PrincipalName"}*First it states a credential class and is followed then by a list of one or more principals identifying the subject.
The principals on their part are specified as the name of the Principal
class followed by the principal name in quotes. For example, the
following file may define permission to read the private credentials of a
principal named "Bob": "com.sun.PrivateCredential com.sun.Principal \"Bob\""
The syntax also allows the use of the wildcard "*" in place of CredentialClass
or PrincipalClass
and/or PrincipalName
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new permission for private credentials specified by the target
name
name and an action . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compares the specified object with this
Permission for equality
and returns true if the specified object is equal, false
otherwise. | |||||||||||
Returns a comma separated string identifying the actions associated with
this permission.
| |||||||||||
Returns the class name of the credential associated with this permission.
| |||||||||||
Returns the principal's classes and names associated with this
PrivateCredentialPermission as a two dimensional array. | |||||||||||
Returns the hash code value for this
Permission . | |||||||||||
Indicates whether the specified permission is implied by this permission.
| |||||||||||
Returns a specific
PermissionCollection container for permissions
of this type. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.security.Permission
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.security.Guard
|
Creates a new permission for private credentials specified by the target
name name
and an action
. The action is always
"read"
.
name | the target name of the permission. |
---|---|
action | the action "read" .
|
Compares the specified object with this Permission
for equality
and returns true
if the specified object is equal, false
otherwise.
The implies(Permission)
method should be used for making access
control checks.
obj | object to be compared for equality with this Permission . |
---|
true
if the specified object is equal to this Permission
, otherwise false
.
Returns a comma separated string identifying the actions associated with this permission. The returned actions are in canonical form. For example:
sp0 = new SocketPermission("www.example.com", "connect,resolve") sp1 = new SocketPermission("www.example.com", "resolve,connect") sp0.getActions().equals(sp1.getActions()) //yields trueBoth permissions return "connect,resolve" (in that order) if
#getActions()
is invoked. Returns an empty String, if no actions are
associated with this permission.Returns the class name of the credential associated with this permission.
Returns the principal's classes and names associated with this PrivateCredentialPermission
as a two dimensional array. The first
dimension of the array corresponds to the number of principals. The
second dimension defines either the name of the PrincipalClass
[x][0] or the value of PrincipalName
[x][1].
This corresponds to the the target name's syntax:
targetName = CredentialClass {PrincipalClass "PrincipalName"}*
PrivateCredentialPermission
.
Returns the hash code value for this Permission
. Returns the same
hash code for Permission
s that are equal to each other as
required by the general contract of hashCode()
.
Permission
.Indicates whether the specified permission is implied by this permission.
The AccessController
uses this method to check whether permission
protected access is allowed with the present policy.
permission | the permission to check against this permission. |
---|
true
if the specified permission is implied by this
permission, false
otherwise.
Returns a specific PermissionCollection
container for permissions
of this type. Returns null
if any permission collection can be
used.
Subclasses may override this method to return an appropriate collection for the specific permissions they implement.
PermissionCollection
or null
if any
permission collection can be used.