- java.lang.Object
-
- java.security.Permission
-
- javax.security.auth.kerberos.ServicePermission
-
- All Implemented Interfaces:
- Serializable, Guard
public final class ServicePermission extends Permission implements Serializable
This class is used to protect Kerberos services and the credentials necessary to access those services. There is a one to one mapping of a service principal and the credentials necessary to access the service. Therefore granting access to a service principal implicitly grants access to the credential necessary to establish a security context with the service principal. This applies regardless of whether the credentials are in a cache or acquired via an exchange with the KDC. The credential can be either a ticket granting ticket, a service ticket or a secret key from a key table.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.
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");
- Since:
- 1.4
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ServicePermission(String servicePrincipal, String action)
Create a newServicePermission
with the specifiedservicePrincipal
andaction
.
-
Method Summary
Methods Modifier and Type Method and Description boolean
equals(Object obj)
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(Permission p)
Checks if this Kerberos service permission object "implies" the specified permission.PermissionCollection
newPermissionCollection()
Returns a PermissionCollection object for storing ServicePermission objects.-
Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
-
-
-
Constructor Detail
-
ServicePermission
public ServicePermission(String servicePrincipal, String action)
Create a newServicePermission
with the specifiedservicePrincipal
andaction
.- Parameters:
servicePrincipal
- the name of the service principal. An asterisk may appear by itself, to signify any service principal.action
- the action string
-
-
Method Detail
-
implies
public boolean implies(Permission p)
Checks if this Kerberos service permission object "implies" the specified permission.If none of the above are true,
implies
returns false.- Specified by:
implies
in classPermission
- Parameters:
p
- the permission to check against.- Returns:
- true if the specified permission is implied by this object, false if not.
-
equals
public boolean equals(Object obj)
Checks two ServicePermission objects for equality.- Specified by:
equals
in classPermission
- Parameters:
obj
- the object to test for equality with this object.- Returns:
- true if obj is a ServicePermission, and has the same service principal, and actions as this ServicePermission object.
- See Also:
Object.hashCode()
,HashMap
-
hashCode
public int hashCode()
Returns the hash code value for this object.- Specified by:
hashCode
in classPermission
- Returns:
- a hash code value for this object.
- See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
getActions
public String getActions()
Returns the canonical string representation of the actions. Always returns present actions in the following order: initiate, accept.- Specified by:
getActions
in classPermission
- Returns:
- the actions of this Permission.
-
newPermissionCollection
public PermissionCollection newPermissionCollection()
Returns a PermissionCollection object for storing ServicePermission objects.
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.- Overrides:
newPermissionCollection
in classPermission
- Returns:
- a new PermissionCollection object suitable for storing ServicePermissions.
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/security/auth/kerberos/ServicePermission.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.