# cryptotokenkit

Guides smart card and driver extension integration using CryptoTokenKit in Swift 6.3 projects.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3100 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/cryptotokenkit/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/cryptotokenkit

## What it does

The skill provides architecture guidance and code patterns for Apple's CryptoTokenKit framework. It covers building `TKSmartCardTokenDriver` extensions for macOS system login, sending APDU commands with `TKSmartCard`, and starting NFC smart card sessions on iOS 26+.

Driver extensions structure work across three parts: the driver entry point, the token object, and the session handling cryptographic operations. To register the extension on macOS, the host app requires a one-time launch under `_securityagent`.

Be aware that `TKSmartCardSlotManager.default` is optional and evaluates to `nil` unless smart card access is enabled. General Secure Enclave primitives and WebAuthn passkeys belong outside this skill.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill cryptotokenkit -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/cryptotokenkit/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/cryptotokenkit/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill cryptotokenkit -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/cryptotokenkit/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill cryptotokenkit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/cryptotokenkit/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills cryptotokenkit
```

2. **Manually: put the files in place**
- File: `.github/skills/cryptotokenkit/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill cryptotokenkit -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/cryptotokenkit
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/cryptotokenkit/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill cryptotokenkit -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/cryptotokenkit/SKILL.md

## When to use it
- build macOS token driver extensions for system authentication
- communicate with contactless smart cards over NFC in iOS
- query token-backed keychain items using kSecAttrTokenID
- observe token insertion and removal with TKTokenWatcher

## Example prompts
- Implement a TKSmartCardTokenDriver subclass and configure Info.plist for macOS.
- How do I start an NFC contactless smart card session with TKSmartCardSlotNFCSession?
- Write a Swift snippet to monitor token events using TKTokenWatcher.

## Similar
- [release-review](https://affpapa.org/en/nevibecode/skills/release-review.md) — skill · 514 installs
- [ios-pentesting-tricks](https://affpapa.org/en/nevibecode/skills/ios-pentesting-tricks.md) — skill · 3700 installs
- [clerk-swift](https://affpapa.org/en/nevibecode/skills/clerk-swift.md) — skill · 14500 installs
- [cmux-architecture](https://affpapa.org/en/nevibecode/skills/cmux-architecture.md) — skill · 4900 installs
- [swiftui-patterns](https://affpapa.org/en/nevibecode/skills/affaan-m-swiftui-patterns.md) — skill · 4600 installs
- [swift-expert](https://affpapa.org/en/nevibecode/skills/swift-expert.md) — skill · 4100 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
