cryptotokenkitlisted
Install: claude install-skill dpearson2699/swift-ios-skills
# CryptoTokenKit
Access security tokens and the cryptographic assets they store using the
CryptoTokenKit framework. Covers token driver extensions, smart card
communication, token sessions, keychain integration, and certificate-based
authentication. Targets Swift 6.3.
**Platform availability:** CryptoTokenKit is primarily a macOS framework.
Smart card reader access (`TKSmartCard`, `TKSmartCardSlotManager`) requires
macOS. Token extension APIs (`TKTokenDriver`, `TKToken`, `TKTokenSession`)
are macOS-only. Client-side token watching (`TKTokenWatcher`) and keychain
queries filtered by `kSecAttrTokenID` are available on iOS 14+/macOS 11+.
NFC smart card slot sessions are available on iOS 16.4+.
## Contents
- [Architecture Overview](#architecture-overview)
- [Token Extensions](#token-extensions)
- [Token Sessions](#token-sessions)
- [Smart Card Communication](#smart-card-communication)
- [Keychain Integration](#keychain-integration)
- [Certificate Authentication](#certificate-authentication)
- [Token Watching](#token-watching)
- [Error Handling](#error-handling)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)
## Architecture Overview
CryptoTokenKit bridges hardware security tokens (smart cards, USB tokens)
with macOS authentication and keychain services. The framework has two main
usage modes:
**Token driver extensions** (macOS only) -- App extensions that make a
hardware token's cryptographic items available to the