Subject
. The Subject
is represented by a Set of Principals.
The target name of this Permission
specifies
a Credential class name, and a Set of Principals.
The only valid value for this Permission's actions is, "read".
The target name must abide by the following syntax:
CredentialClass {PrincipalClass "PrincipalName"}*For example, the following permission grants access to the com.sun.PrivateCredential owned by Subjects which have a com.sun.Principal with the name, "duke". Note that although this example, as well as all the examples below, do not contain Codebase, SignedBy, or Principal information in the grant statement (for simplicity reasons), actual policy configurations should specify that information when appropriate.
grant { permission javax.security.auth.PrivateCredentialPermission "com.sun.PrivateCredential com.sun.Principal \"duke\"", "read"; };If CredentialClass is "*", then access is granted to all private Credentials belonging to the specified
Subject
.
If "PrincipalName" is "*", then access is granted to the
specified Credential owned by any Subject
that has the
specified Principal
(the actual PrincipalName doesn't matter).
For example, the following grants access to the
a.b.Credential owned by any Subject
that has
an a.b.Principal.
grant { permission javax.security.auth.PrivateCredentialPermission "a.b.Credential a.b.Principal "*"", "read"; };If both the PrincipalClass and "PrincipalName" are "*", then access is granted to the specified Credential owned by any
Subject
.
In addition, the PrincipalClass/PrincipalName pairing may be repeated:
grant { permission javax.security.auth.PrivateCredentialPermission "a.b.Credential a.b.Principal "duke" c.d.Principal "dukette"", "read"; };The above grants access to the private Credential, "a.b.Credential", belonging to a
Subject
with at least two associated Principals:
"a.b.Principal" with the name, "duke", and "c.d.Principal", with the name,
"dukette".
Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private String | |
private transient PrivateCredentialPermission. | |
private static final PrivateCredentialPermission. | |
private Set | |
private static final long |
Access | Constructor and Description |
---|---|
pack-priv | PrivateCredentialPermission(String credentialClass, Set<Principal> principals)
Create a new |
public | PrivateCredentialPermission(String
the name specifying the Credential class and
name, String Principal Set.the actions specifying that the Credential can be read. actions)Creates a new |
Modifier and Type | Method and Description |
---|---|
public boolean | Returns: true if obj is aPrivateCredentialPermission ,
has the same credential class as this object,
and has the same Principals as this object.the object we are testing for equality with this object. obj)Implements abstract java. Checks two |
public String | Returns: the actions (always returns "read").Implements abstract java. Returns the "canonical string representation" of the actions. |
public String | Returns: the Class name of the Credential associated with thisPrivateCredentialPermission .Returns the Class name of the Credential associated with this
|
public String[][] | Returns: thePrincipal class and names associated
with this PrivateCredentialPermission .Returns the |
public int | Returns: the hash code value for this objectImplements abstract java. Returns the hash code value for this object. |
public boolean | Returns: true if thisPrivateCredentialPermission implies
the specified Permission , false if not.the p)Permission to check against.Implements abstract java. Checks if this |
private boolean | |
private boolean | |
private void | |
public PermissionCollection | Returns: null in all cases.Overrides java. Return a homogeneous collection of PrivateCredentialPermissions
in a |
private void | readObject(ObjectInputStream
the s)ObjectInputStream from which data is readReads this object from a stream (i.e., deserializes it) |
credentialClass | back to summary |
---|---|
private String credentialClass |
credOwners | back to summary |
---|---|
private transient PrivateCredentialPermission. |
EMPTY_PRINCIPALS | back to summary |
---|---|
private static final PrivateCredentialPermission. |
principals | back to summary |
---|---|
private Set<Principal> principals
|
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID Hides java. |
PrivateCredentialPermission | back to summary |
---|---|
pack-priv PrivateCredentialPermission(String credentialClass, Set<Principal> principals) Create a new |
PrivateCredentialPermission | back to summary |
---|---|
public PrivateCredentialPermission(String name, String actions) Creates a new
|
equals | back to summary |
---|---|
public boolean equals(Object obj) Implements abstract java. Checks two |
getActions | back to summary |
---|---|
public String getActions() Implements abstract java. Returns the "canonical string representation" of the actions. This method always returns the String, "read".
|
getCredentialClass | back to summary |
---|---|
public String getCredentialClass() Returns the Class name of the Credential associated with this
|
getPrincipals | back to summary |
---|---|
public String[][] getPrincipals() Returns the
|
hashCode | back to summary |
---|---|
public int hashCode() Implements abstract java. Returns the hash code value for this object.
|
implies | back to summary |
---|---|
public boolean implies(Permission p) Implements abstract java. Checks if this This method returns true if:
|
impliesCredentialClass | back to summary |
---|---|
private boolean impliesCredentialClass(String thisC, String thatC) |
impliesPrincipalSet | back to summary |
---|---|
private boolean impliesPrincipalSet(PrivateCredentialPermission. |
init | back to summary |
---|---|
private void init(String name) |
newPermissionCollection | back to summary |
---|---|
public PermissionCollection newPermissionCollection() Overrides java. Return a homogeneous collection of PrivateCredentialPermissions
in a
|
readObject | back to summary |
---|---|
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Reads this object from a stream (i.e., deserializes it)
|
Modifier and Type | Field and Description |
---|---|
pack-priv String | |
pack-priv String | |
private static final long |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public boolean | |
public String |
principalClass | back to summary |
---|---|
pack-priv String principalClass |
principalName | back to summary |
---|---|
pack-priv String principalName |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID
|
CredOwner | back to summary |
---|---|
pack-priv CredOwner(String principalClass, String principalName) |
implies | back to summary |
---|---|
public boolean implies(Object obj) |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
|