Returns the value of a single entitlement for the represented task.


func SecTaskCopyValueForEntitlement(_ task: SecTask, _ entitlement: CFString, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> CFTypeRef?



The task whose entitlement you want.


The name of the entitlement to be fetched.


A pointer that the function uses to provide an error object with details if an error occurs. The caller becomes responsible for the object's memory. Pass NULL to ignore the error.

Return Value

The value of the specified entitlement for the process or nil if the entitlement value could not be retrieved. The type of the returned value depends on the entitlement specified.


An empty return value may indicate an error, or it may indicate that the entitlement is simply not present. In the latter case, no error is returned.

See Also


func SecTaskCreateFromSelf(CFAllocator?) -> SecTask?

Creates a task object for the current task.

func SecTaskCreateWithAuditToken(CFAllocator?, audit_token_t) -> SecTask?

Creates a task object for the task that sent the Mach message represented by the audit token.

class SecTask

The Core Foundation type representing a task.

func SecTaskGetTypeID() -> CFTypeID

Returns the unique identifier of the opaque type to which a task object belongs.