Serializable
, Guard
public final class ServicePermission extends Permission implements Serializable
A ServicePermission contains a service principal name and a list of actions which specify the context the credential can be used within.
The service principal name is the canonical name of the KerberosPrincipal
supplying the service, that is the KerberosPrincipal represents a Kerberos service principal. This name is treated in a case sensitive manner. An asterisk may appear by itself, to signify any service principal.
Granting this permission implies that the caller can use a cached credential (TGT, service ticket or secret key) within the context designated by the action. In the case of the TGT, granting this permission also implies that the TGT can be obtained by an Authentication Service exchange.
Granting this permission also implies creating KerberosPrincipal
or GSSName
without providing a Kerberos realm, as long as the permission's service principal is in this realm.
The possible actions are:
initiate - allow the caller to use the credential to initiate a security context with a service principal. accept - allow the caller to use the credential to accept security context as a particular principal.For example, to specify the permission to access to the TGT to initiate a security context the permission is constructed as follows:
ServicePermission("krbtgt/[email protected]", "initiate");
To obtain a service ticket to initiate a context with the "host" service the permission is constructed as follows:
ServicePermission("host/[email protected]", "initiate");
For a Kerberized server the action is "accept". For example, the permission necessary to access and use the secret key of the Kerberized "host" service (telnet and the likes) would be constructed as follows:
ServicePermission("host/[email protected]", "accept");
Constructor | Description |
---|---|
ServicePermission |
Create a new ServicePermission with the specified servicePrincipal and action . |
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals |
Checks two ServicePermission objects for equality. |
String |
getActions() |
Returns the canonical string representation of the actions. |
int |
hashCode() |
Returns the hash code value for this object. |
boolean |
implies |
Checks if this Kerberos service permission object "implies" the specified permission. |
PermissionCollection |
newPermissionCollection() |
Returns a PermissionCollection object for storing ServicePermission objects. |
checkGuard, getName, toString
public ServicePermission(String servicePrincipal, String action)
ServicePermission
with the specified servicePrincipal
and action
.servicePrincipal
- the name of the service principal. An asterisk may appear by itself, to signify any service principal.action
- the action stringpublic boolean implies(Permission p)
More specifically, this method returns true if all the following are true (and returns false if any of them are not):
ServicePermission
, ServicePermission
's actions, ServicePermission
's name or this ServicePermission
's name is "*". implies
in class Permission
p
- the permission to check against.public boolean equals(Object obj)
equals
in class Permission
obj
- the object to test for equality with this object.obj
is a ServicePermission, and has the same service principal, and actions as this ServicePermission object.public int hashCode()
hashCode
in class Permission
public String getActions()
getActions
in class Permission
Permission
.public PermissionCollection newPermissionCollection()
newPermissionCollection
in class Permission
© 1993, 2023, 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/21/docs/api/java.security.jgss/javax/security/auth/kerberos/ServicePermission.html