# Class DelegationPermission

java.lang.Object
java.security.Permission
java.security.BasicPermission
javax.security.auth.kerberos.DelegationPermission

All Implemented Interfaces:
  `Serializable, Guard`

@Deprecated(since="25", forRemoval=true) public final class DelegationPermission extends BasicPermission implements Serializable
Deprecated, for removal: This API element is subject to removal in a future version.
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
This class is for Kerberos delegation permissions.

The target name of this `Permission` specifies a pair of kerberos service principals. The first is the subordinate service principal being entrusted to use the TGT. The second service principal designates the target service the subordinate service principal is to interact with on behalf of the initiating KerberosPrincipal. This latter service principal is specified to restrict the use of a proxiable ticket.

Since:
  1.4
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`DelegationPermission(String principals)`
Deprecated, for removal: This API element is subject to removal in a future version.
Create a new `DelegationPermission` with the specified subordinate and target principals.
`DelegationPermission(String principals, String actions)`
Deprecated, for removal: This API element is subject to removal in a future version.
Create a new `DelegationPermission` with the specified subordinate and target principals.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Deprecated, for removal: This API element is subject to removal in a future version.
Checks two DelegationPermission objects for equality.
`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(Permission p)`
Deprecated, for removal: This API element is subject to removal in a future version.
Checks if this Kerberos delegation permission object "implies" the specified permission.
`PermissionCollection`
`newPermissionCollection()`
Deprecated, for removal: This API element is subject to removal in a future version.
Returns a PermissionCollection object for storing DelegationPermission objects.

### Methods declared in class BasicPermission

`getActions`
Modifier and Type
Method
Description
`String`
`getActions()`
Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for a `BasicPermission`.

### Methods declared in class Permission

`checkGuard, getName, toString`
Modifier and Type
Method
Description
`void`
`checkGuard(Object object)`
Implements the guard interface for a permission.
`final String`
`getName()`
Returns the name of this `Permission`.
`String`
`toString()`
Returns a string describing this `Permission`.

### Methods declared in class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
Modifier and Type
Method
Description
`protected Object`
`clone()`
Creates and returns a copy of this object.
`protected void`
`finalize()`
Deprecated, for removal: This API element is subject to removal in a future version.
Finalization is deprecated and subject to removal in a future release.
`final Class<?>`
`getClass()`
Returns the runtime class of this `Object`.
`final void`
`notify()`
Wakes up a single thread that is waiting on this object's monitor.
`final void`
`notifyAll()`
Wakes up all threads that are waiting on this object's monitor.
`final void`
`wait()`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
`final void`
`wait(long timeoutMillis)`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
`final void`
`wait(long timeoutMillis, int nanos)`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

## Constructor Details

### DelegationPermission

public DelegationPermission(String principals)
Deprecated, for removal: This API element is subject to removal in a future version.
Create a new `DelegationPermission` with the specified subordinate and target principals.

Parameters:
  `principals` - the name of the subordinate and target principals
Throws:
  `NullPointerException` - if `principals` is `null`.
  `IllegalArgumentException` - if `principals` is empty, or does not contain a pair of principals, or is improperly quoted

### DelegationPermission

public DelegationPermission(String principals, String actions)
Deprecated, for removal: This API element is subject to removal in a future version.
Create a new `DelegationPermission` with the specified subordinate and target principals.

Parameters:
  `principals` - the name of the subordinate and target principals
  `actions` - should be null.
Throws:
  `NullPointerException` - if `principals` is `null`.
  `IllegalArgumentException` - if `principals` is empty, or does not contain a pair of principals, or is improperly quoted

## Method Details

### implies

public boolean implies(Permission p)
Deprecated, for removal: This API element is subject to removal in a future version.
Checks if this Kerberos delegation permission object "implies" the specified permission.

This method returns true if this `DelegationPermission` is equal to `p`, and returns false otherwise.

Overrides:
  `implies` in class `BasicPermission`
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)
Deprecated, for removal: This API element is subject to removal in a future version.
Checks two DelegationPermission objects for equality.

Overrides:
  `equals` in class `BasicPermission`
Parameters:
  `obj` - the object to test for equality with this object.
Returns:
  true if `obj` is a DelegationPermission, and has the same subordinate and service principal as this DelegationPermission object.
See Also:
  - `Object.hashCode()`
  - `HashMap`

### hashCode

public int hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.
Returns the hash code value for this object.

Overrides:
  `hashCode` in class `BasicPermission`
Returns:
  the hash code value for this object
See Also:
  - `Object.equals(java.lang.Object)`
  - `System.identityHashCode(Object)`

### newPermissionCollection

public PermissionCollection newPermissionCollection()
Deprecated, for removal: This API element is subject to removal in a future version.
Returns a PermissionCollection object for storing DelegationPermission objects.
DelegationPermission 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 class `BasicPermission`
Returns:
  a new PermissionCollection object suitable for storing DelegationPermissions.