Class PrivateCredentialPermission
- All Implemented Interfaces:
Serializable, Guard
@Deprecated(since="25", forRemoval=true) public final class PrivateCredentialPermission extends Permission
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"}*
- Since:
- 1.4
- See Also:
Constructor Summary
| Constructor | Description |
|---|---|
PrivateCredentialPermission |
Deprecated, for removal: This API element is subject to removal in a future version. Creates a new PrivateCredentialPermission with the specified name. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals |
Deprecated, for removal: This API element is subject to removal in a future version. Checks two PrivateCredentialPermission objects for equality. |
String |
getActions() |
Deprecated, for removal: This API element is subject to removal in a future version. Returns the "canonical string representation" of the actions. |
String |
getCredentialClass() |
Deprecated, for removal: This API element is subject to removal in a future version. Returns the Class name of the Credential associated with this PrivateCredentialPermission. |
String[][] |
getPrincipals() |
Deprecated, for removal: This API element is subject to removal in a future version. Returns the Principal classes and names associated with this PrivateCredentialPermission. |
int |
hashCode() |
Deprecated, for removal: This API element is subject to removal in a future version. Returns the hash code value for this object. |
boolean |
implies |
Deprecated, for removal: This API element is subject to removal in a future version. Checks if this PrivateCredentialPermission implies the specified Permission. |
PermissionCollection |
newPermissionCollection() |
Deprecated, for removal: This API element is subject to removal in a future version. Return a homogeneous collection of PrivateCredentialPermissions in a PermissionCollection. |
Methods declared in class Permission
checkGuard, getName, toString
Constructor Details
PrivateCredentialPermission
public PrivateCredentialPermission(String name, String actions)
PrivateCredentialPermission with the specified name. The name specifies both a Credential class and a Principal Set.- Parameters:
-
name- the name specifying the Credential class andPrincipalSet. -
actions- the actions specifying that the Credential can be read. - Throws:
-
IllegalArgumentException- ifnamedoes not conform to the correct syntax or ifactionsis not "read".
Method Details
getCredentialClass
public String getCredentialClass()
PrivateCredentialPermission.- Returns:
- the Class name of the Credential associated with this
PrivateCredentialPermission.
getPrincipals
public String[][] getPrincipals()
Principal classes and names associated with this PrivateCredentialPermission. The information is returned as a two-dimensional array (array[x][y]). The 'x' value corresponds to the number of Principal class and name pairs. When (y==0), it corresponds to the Principal class value, and when (y==1), it corresponds to the Principal name value. For example, array[0][0] corresponds to the class name of the first Principal in the array. array[0][1] corresponds to the Principal name of the first Principal in the array.- Returns:
- the
Principalclass and names associated with thisPrivateCredentialPermission.
implies
public boolean implies(Permission p)
PrivateCredentialPermission implies the specified Permission. This method returns true if:
-
pis an instanceof PrivateCredentialPermission and - the target name for
pis implied by this object's target name. For example:[* P1 "duke"] implies [a.b.Credential P1 "duke"]. [C1 P1 "duke"] implies [C1 P1 "duke" P2 "dukette"]. [C1 P2 "dukette"] implies [C1 P1 "duke" P2 "dukette"].
- Specified by:
-
impliesin classPermission - Parameters:
-
p- thePermissionto check against. - Returns:
- true if this
PrivateCredentialPermissionimplies the specifiedPermission, false if not.
equals
public boolean equals(Object obj)
PrivateCredentialPermission objects for equality. Checks that obj is a PrivateCredentialPermission, and has the same credential class as this object, as well as the same Principals as this object. The order of the Principals in the respective Permission's target names is not relevant.- Specified by:
-
equalsin classPermission - Parameters:
-
obj- the object we are testing for equality with this object. - Returns:
- true if obj is a
PrivateCredentialPermission, has the same credential class as this object, and has the same Principals as this object. - See Also:
hashCode
public int hashCode()
- Specified by:
-
hashCodein classPermission - Returns:
- the hash code value for this object
- See Also:
getActions
public String getActions()
- Specified by:
-
getActionsin classPermission - Returns:
- the actions (always returns "read").
newPermissionCollection
public PermissionCollection newPermissionCollection()
PermissionCollection. No such PermissionCollection is defined, so this method always returns null.- Overrides:
-
newPermissionCollectionin classPermission - Returns:
- null in all cases.
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/javax/security/auth/PrivateCredentialPermission.html