javax.security.auth.kerberos
Class ServicePermission
- java.lang.Object
java.security.Permission
javax.security.auth.kerberos.ServicePermission
- public final class ServicePermission
- extends java.security.Permission
- implements java.io.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
KereberosPrincipal
supplying the service, that is the
KerberosPrincipal represents a Kerberos service principal. This name is
treated in a case sensitive manner.
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.
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/EXAMPLE.COM@EXAMPLE.COM", "initiate");
To obtain a service ticket to initiate a context with the "host" service the permission is constructed as follows:
ServicePermission("host/foo.example.com@EXAMPLE.COM", "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/foo.example.com@EXAMPLE.COM", "accept");
Constructor Summary
Constructor and Description |
---|
ServicePermission(java.lang.String servicePrinicipal,java.lang.String action)
Create a new
ServicePermission with the specified
servicePrincipal and action .
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
equals(java.lang.Object obj)
Checks two ServicePermission objects for equality.
|
|
getActions()
Returns the canonical string representation of the actions.
|
|
hashCode()
Returns the hash code value for this object.
|
|
implies(java.security.Permission p)
Checks if this Kerberos service permission object "implies" the
specified permission.
|
|
newPermissionCollection()
Returns a PermissionCollection object for storing ServicePermission
objects.
|
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 |
Constructor Detail
ServicePermission
- public ServicePermission(java.lang.String servicePrinicipal,
- java.lang.String action)
servicePrinicipal
- the name of the service principal
action
- the action string Method Detail
implies
- public boolean implies(java.security.Permission p)
If none of the above are true, implies
returns false.
implies
in class java.security.Permission
p
- the permission to check against. equals
- public boolean equals(java.lang.Object obj)
equals
in class java.security.Permission
obj
- the object to test for equality with this object. hashCode
- public int hashCode()
hashCode
in class java.security.Permission
getActions
- public java.lang.String getActions( )
getActions
in class java.security.Permission
newPermissionCollection
- public java.security.PermissionCollection newPermissionCollection( )
ServicePermission objects must be stored in a manner that allows them to be inserted into the collection in any order, but that also enables the PermissionCollection implies method to be implemented in an efficient (and consistent) manner.
newPermissionCollection
in class java.security.Permission
ServicePermission
with the specifiedservicePrincipal
andaction
.