<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKTokenDriver",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKTokenDriver"
  },
  "title" : "TKTokenDriver"
}
-->

# TKTokenDriver

A base class for building token drivers.

```
class TKTokenDriver
```

## Overview

When using the [`TKTokenDriver`](/documentation/CryptoTokenKit/TKTokenDriver) class, implement the [`TKTokenDriverDelegate`](/documentation/CryptoTokenKit/TKTokenDriverDelegate) protocol with the [`tokenDriver(_:tokenFor:)`](/documentation/CryptoTokenKit/TKTokenDriverDelegate/tokenDriver(_:tokenFor:)) method, which the system invokes when it requests the creation of a token instance. After you create the token driver, it can examine [`keychainItems`](/documentation/CryptoTokenKit/TKToken/Configuration-swift.class/keychainItems) and [`configurationData`](/documentation/CryptoTokenKit/TKToken/Configuration-swift.class/configurationData) to implement your desired functionality.

An implementation can also access its associated token configuration using the [`TKToken.Configuration`](/documentation/CryptoTokenKit/TKToken/Configuration-swift.class) property.

> Note:
> When working with smart card tokens, use or inherit from the ``doc://com.apple.cryptotokenkit/documentation/CryptoTokenKit/TKSmartCardTokenDriver`` subclass instead.

## Topics

### Responding to Token Creation

[`delegate`](/documentation/CryptoTokenKit/TKTokenDriver/delegate)

The token driver delegate.

[`TKTokenDriverDelegate`](/documentation/CryptoTokenKit/TKTokenDriverDelegate)

The interface that a token driver delegate implements to respond to token creation events.

[`ClassID`](/documentation/CryptoTokenKit/TKTokenDriver/ClassID)

The type of the class identifier for the token driver.

[`Configuration`](/documentation/CryptoTokenKit/TKTokenDriver/Configuration)

A configuration for one class of token.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Inherited By

[`TKSmartCardTokenDriver`](/documentation/CryptoTokenKit/TKSmartCardTokenDriver)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)