Movatterモバイル変換


[0]ホーム

URL:


         


Class PrivateCredentialPermission

java.lang.Object  |  +--java.security.Permission        |        +--javax.security.auth.PrivateCredentialPermission
All Implemented Interfaces:
java.security.Guard, java.io.Serializable

public final classPrivateCredentialPermission
extends java.security.Permission

This class is used to protect access to private Credentials belonging to a particularSubject. TheSubject is represented by a Set of Principals.

The target name of thisPermission 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 specifiedSubject. If "PrincipalName" is "*", then access is granted to the specified Credential owned by anySubject that has the specifiedPrincipal (the actual PrincipalName doesn't matter). For example, the following grants access to the a.b.Credential owned by anySubject 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 anySubject.

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 aSubject with at least two associated Principals: "a.b.Principal" with the name, "duke", and "c.d.Principal", with the name, "dukette".

See Also:
Serialized Form

PrivateCredentialPermission(java.lang.String name, java.lang.String actions)
          Creates a newPrivateCredentialPermission with the specifiedname.
 
equals(java.lang.Object obj)
          Checks twoPrivateCredentialPermission objects for equality.
getActions()
          Returns the "canonical string representation" of the actions.
getCredentialClass()
          Returns the Class name of the Credential associated with thisPrivateCredentialPermission.
getPrincipals()
          Returns thePrincipal classes and names associated with thisPrivateCredentialPermission.
hashCode()
          Returns the hash code value for this object.
implies(java.security.Permission p)
          Checks if thisPrivateCredentialPermission implies the specifiedPermission.
newPermissionCollection()
          Return a homogeneous collection of PrivateCredentialPermissions in aPermissionCollection.
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

PrivateCredentialPermission

publicPrivateCredentialPermission(java.lang.String name,                                   java.lang.String actions)
Creates a newPrivateCredentialPermission with the specifiedname. Thename specifies both a Credential class and aPrincipal Set.

Parameters:
name - the name specifying the Credential class andPrincipal Set.

actions - the actions specifying that the Credential can be read.

getCredentialClass

public java.lang.StringgetCredentialClass()
Returns the Class name of the Credential associated with thisPrivateCredentialPermission.

Returns:
the Class name of the Credential associated with thisPrivateCredentialPermission.

getPrincipals

public java.lang.String[][]getPrincipals()
Returns thePrincipal classes and names associated with thisPrivateCredentialPermission. The information is returned as a two-dimensional array (array[x][y]). The 'x' value corresponds to the number ofPrincipal class and name pairs. When (y==0), it corresponds to thePrincipal class value, and when (y==1), it corresponds to thePrincipal name value. For example, array[0][0] corresponds to the class name of the firstPrincipal in the array. array[0][1] corresponds to thePrincipal name of the firstPrincipal in the array.

Returns:
thePrincipal class and names associatedwith thisPrivateCredentialPermission.

implies

public booleanimplies(java.security.Permission p)
Checks if thisPrivateCredentialPermission implies the specifiedPermission.

This method returns true if:

Overrides:
implies in classjava.security.Permission
Parameters:
p - thePermission to check against.

equals

public booleanequals(java.lang.Object obj)
Checks twoPrivateCredentialPermission objects for equality. Checks thatobj is aPrivateCredentialPermission, and has the same target name as this object.

Overrides:
equals in classjava.security.Permission
Parameters:
obj - the object we are testing for equality with this object.
Returns:
true if obj is aPrivateCredentialPermission,and has the same target name.

hashCode

public inthashCode()
Returns the hash code value for this object.
Overrides:
hashCode in classjava.security.Permission
Returns:
a hash code value for this object.

getActions

public java.lang.StringgetActions()
Returns the "canonical string representation" of the actions. This method always returns the String, "read".

Overrides:
getActions in classjava.security.Permission
Returns:
the actions (always returns "read").

newPermissionCollection

public java.security.PermissionCollectionnewPermissionCollection()
Return a homogeneous collection of PrivateCredentialPermissions in aPermissionCollection. No suchPermissionCollection is defined, so this method always returnsnull.

Overrides:
newPermissionCollection in classjava.security.Permission
Returns:
null in all cases.

         


[8]ページ先頭

©2009-2025 Movatter.jp