LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

cryptotokenkit

Access security tokens and smart cards using CryptoTokenKit. Use when building TKTokenDriver or TKSmartCardTokenDriver extensions, communicating with smart cards via TKSmartCard/TKSmartCardSlotManager, using iOS 26+ NFC smart-card sessions, registering smart cards, querying token-backed keychain items with kSecAttrTokenID, monitoring TKTokenWatcher, or configuring certificate-based smart-card authentication.

857stars43forksUpdated 7/9/2026
Developer Tools#ios-development#smart-cards#security-tokens#cryptotokenkit#swift#keychain

Security Assessment

Low Risk(80/100)

Detected risks:

Privilege Escalation([SKILL.md] sudo)
Security Score80/100

About cryptotokenkit

Guidance for using Apple's CryptoTokenKit framework to access hardware security tokens and smart cards from Swift 6.3 apps. The framework bridges smart cards and USB tokens with authentication and keychain services across Apple platforms, with capability gated by extension point, entitlement, hardware, and OS version. It covers three usage modes. Smart-card token extensions are macOS app extensions that expose a hardware token's cryptographic items to system login and keychain unlock; such an extension comprises a TokenDriver (subclassing TKSmartCardTokenDriver), a Token (subclassing TKSmartCardToken) that reads certificates and keys and fills its keychainContents, and a TokenSession (subclassing TKSmartCardTokenSession) that reports supported algorithms and performs signing, decryption, and key-exchange operations through its delegate. Client-side token access lets ordinary apps query the keychain for token-backed items (via kSecAttrTokenID) that appear as standard entries when a token is present. NFC smart-card access, new in iOS and iPadOS 26, creates a temporary NFC slot and communicates with a contactless card through TKSmartCard, with registration for later keychain use. The skill documents the key types - TKTokenDriver/TKToken/TKTokenSession, TKSmartCard and TKSmartCardSlotManager (whose default is optional and returns nil unless smart-card access is enabled), TKTokenWatcher for insertion and removal, and the iOS 26 NFC session and registration managers - along with PIN entry by returning a TKTokenAuthOperation such as TKTokenSmartCardPINAuthOperation from beginAuthFor:, and the required Info.plist keys (NSExtensionPointIdentifier com.apple.ctk-tokens naming the driver class) plus one-time registration by launching the host app as the _securityagent user. It also sets boundaries: passkeys, WebAuthn, and account sign-in route to an authentication skill, while Secure Enclave, CryptoKit primitives, keychain architecture, certificate pinning, and trust policy route to swift-security.

FAQ

What are the three usage modes of CryptoTokenKit?

Smart-card token extensions (macOS app extensions for system login and keychain unlock), client-side token access (querying the keychain for token-backed items), and NFC smart-card access on iOS/iPadOS 26+.

Which classes make up a smart-card token extension?

A TokenDriver subclassing TKSmartCardTokenDriver, a Token subclassing TKSmartCardToken, and a TokenSession subclassing TKSmartCardTokenSession that performs the cryptographic operations.

How do I prompt for a smart-card PIN?

Return a TKTokenAuthOperation (for example a TKTokenSmartCardPINAuthOperation with its pinFormat configured) from the session's beginAuthFor: delegate method before cryptographic operations.

How is the token extension registered with the system?

Its Info.plist names the driver class under NSExtensionAttributes with NSExtensionPointIdentifier com.apple.ctk-tokens, and you register it once by launching the host app as the _securityagent user.

When should I use a different skill instead?

Route passkeys, WebAuthn, and account sign-in to the authentication skill, and route Secure Enclave, CryptoKit primitives, keychain architecture, certificate pinning, and trust policy to swift-security.

All Files

3 files
SKILL.md17.9 KB
View
evals/evals.json3.9 KB
View
references/cryptotokenkit-patterns.md21.5 KB
View

Install cryptotokenkit

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

dpearson2699/swift-ios-skills

Related Skills

parallel-web

45,195

create-blazor-project

5,423

od-contribute

96,513

redesign-existing-projects

96,513