Instance Method


Tells the delegate that authentication has begun for the specified operation and constraint.


optional func tokenSession(_ session: TKTokenSession, beginAuthFor operation: TKTokenOperation, constraint: Any) throws -> TKTokenAuthOperation



The token session.


The kind of operation.


The constraint to be satisfied.


If an error occurred, this method should return nil and populate this parameter with an object containing details of the error. The error object should have a domain equal to TKErrorDomain and a code equal to a value defined by the TKError.Code enumeration.

Return Value

The resulting context of the operation, or nil if an error occurred.

If you return an instance of a subclass of TKTokenAuthOperation that is provided by the CryptoTokenKit framework, the system will first fill in the context-specific properties, such as the password, before calling the finishWithError: method on the context.

See Also


typealias TKTokenOperationConstraint

A token's authentication constraint for a specific operation.

class TKTokenAuthOperation

An authentication operation for a cryptographic token.

class TKTokenPasswordAuthOperation

A password-based authentication operation.

class TKTokenSmartCardPINAuthOperation

A Smart Card PIN authentication operation.