---
title: "tokenDriver(_:tokenFor:)"
framework: cryptotokenkit
role: symbol
role_heading: Instance Method
path: "cryptotokenkit/tktokendriverdelegate/tokendriver(_:tokenfor:)"
---

# tokenDriver(_:tokenFor:)

Creates a new token for the configuration you specify.

## Declaration

```swift
optional func tokenDriver(_ driver: TKTokenDriver, tokenFor configuration: TKToken.Configuration) throws -> TKToken
```

## Parameters

- `driver`: The token driver.
- `configuration`: The configuration that identifies the token to create.

## Return Value

Return Value The created token.

## Discussion

Discussion The system invokes this method to request creation of a token instance, which the instanceID property of the configuration you specify identifies. The created token has access to its current configuration using the configurationData property, which can provide token-implementation-specific additional data. The token can access keychain items this token exports with the methods key(for:) and certificate(for:) that the configuration provides. note: Smart card token drivers must not implement this method.

## See Also

### Creating and Removing Tokens

- [tokenDriver(_:terminateToken:)](cryptotokenkit/tktokendriverdelegate/tokendriver(_:terminatetoken:).md)
