Community-maintained Agent Skills for complete Swift and Apple-platform app delivery.
72
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Use CryptoTokenKit for token-driver extensions, smart-card sessions, token-backed Keychain items, certificate authentication, and iOS/iPadOS 26+ NFC smart-card access.
API presence is not an access guarantee: extension points, entitlements,
hardware, and runtime support all matter. The login/keychain-unlock token
extension flow is macOS-specific, TKSmartCardSlotManager.default is optional,
and NFC smart-card slot creation requires iOS/iPadOS 26+.
CryptoTokenKit has three distinct modes:
TKSmartCard.Own token/smart-card sessions, token-backed items, APDUs, PIN operations, and
smart-card certificate authentication here. Route passkeys/WebAuthn and account
sign-in to authentication; route CryptoKit primitives, Secure Enclave,
ordinary Keychain architecture, pinning, and trust policy to swift-security.
| Type | Role | Important constraint |
|---|---|---|
TKTokenDriver, TKToken, TKTokenSession | Driver/token/session primitives | Extension behavior depends on platform and extension point |
TKSmartCardTokenDriver | Smart-card driver entry point | System login integration is a macOS extension flow |
TKSmartCard, TKSmartCardSlotManager | Reader discovery and APDU transport | Default manager may be nil |
TKTokenWatcher | Token insertion/removal | Retain it for the monitoring lifetime |
TKSmartCardSlotNFCSession | Temporary NFC-backed slot | iOS/iPadOS 26+; always end the session |
TKSmartCardTokenRegistrationManager | NFC token registration | iOS/iPadOS 26+ |
com.apple.ctk-tokens and the exact
com.apple.ctk.driver-class; the host app is only its delivery vehicle.TKTokenKeychainContents with stable, matching object IDs.
TKTokenKeychainKey capabilities must reflect the hardware.TKTokenSessionDelegate.supports returns true only for algorithms and
operations the token actually implements.send calls in withSession; for raw transmit, pair
beginSession and endSession on every path.errSecItemNotFound.TKTokenSmartCardPINAuthOperation from the real card format and
APDU layout; never log or retain PIN bytes.TKSmartCardSlotNFCSession, including error and cancellation paths.import CryptoTokenKit
guard let manager = TKSmartCardSlotManager.default else {
// Missing entitlement/access, unsupported runtime, or no smart-card service.
return
}On iOS/iPadOS 26+, also require manager.isNFCSupported() before creating an
NFC slot. Keep macOS configuration and system-authentication guidance outside
iOS-only branches. Do not force unwrap a manager, slot, card, certificate, or
keychain item obtained from hardware.
Handle TKError according to recovery semantics:
| Error | Expected response |
|---|---|
.canceledByUser | Stop quietly or restore prior UI state |
.authenticationFailed / .authenticationNeeded | Present bounded retry or authentication UI |
.tokenNotFound / .objectNotFound | Ask for reinsertion or refresh token contents |
.communicationError | End the session and offer a fresh attempt |
.corruptedData | Reject the response; do not parse or trust partial data |
.notImplemented | Disable the unsupported operation |
Preserve smart-card-specific status information in app errors without exposing secrets. Avoid blind retries of PIN or destructive card commands.
.tessl-plugin
skills
accessorysetupkit
references
activitykit
adattributionkit
references
alarmkit
references
app-clips
app-intents
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
audioaccessorykit
references
authentication
references
avfoundation-audio
references
avkit
background-processing
references
browserenginekit
callkit
references
carplay
cloudkit
contacts-framework
references
core-bluetooth
references
core-data
core-haptics
references
core-motion
references
core-nfc
references
coreml
references
cryptokit
cryptotokenkit
debugging-instruments
device-integrity
references
energykit
references
eventkit
family-controls
references
financekit
focus-engine
gamekit
git-branching-workflow
references
healthkit
references
homekit
references
ios-accessibility
ios-app-workflow
references
ios-ettrace-performance
ios-localization
ios-memgraph-analysis
ios-networking
ios-simulator
references
metrickit
references
musickit
references
natural-language
paperkit
references
passkit
references
pdfkit
pencilkit
references
permissionkit
references
photokit
push-notifications
quicklook
references
realitykit
references
relevancekit
references
scenekit
sensorkit
shazamkit
references
speech-recognition
references
spritekit
storekit
swift-api-design-guidelines
swift-architecture
references
swift-charts
swift-codable
references
swift-code-review
swift-concurrency
swift-formatstyle
references
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-responsive-layout
swiftui-uikit-interop
swiftui-webkit
tabletopkit
tipkit
vision-framework
weatherkit
references