cryptotokenkit

Access hardware security tokens and smart cards via CryptoTokenKit APIs.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/KumarAdi8/AgentKit --skill cryptotokenkit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cryptotokenkit
Source: https://github.com/KumarAdi8/AgentKit/tree/main/skills/cryptotokenkit
Command: npx skills add https://github.com/KumarAdi8/AgentKit --skill cryptotokenkit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

CryptoTokenKit simplifies accessing and managing hardware-backed cryptographic keys and certificates so applications can perform signing, decryption, and authentication using smart cards and USB/NFC tokens without leaking secrets or mismanaging sessions. It clarifies platform availability and differences between macOS token driver extensions and client-side token access on macOS/iOS.

Core Features & Use Cases

  • Token driver extensions (macOS): Build TKSmartCardTokenDriver/TKToken-backed extensions that expose token keys and certificates to the system and populate keychain items with proper objectIDs and capabilities.
  • Smart card communication & APDU handling: Open secure sessions, send APDU commands, handle chained responses, and interpret status words safely.
  • Token sessions & authentication: Implement TKTokenSession/TKTokenSessionDelegate, PIN and secure PIN flows, and algorithm capability checks to avoid unsupported operations.
  • Keychain & system integration: Query token-backed items using kSecAttrTokenID, use persistent refs, and handle errSecItemNotFound when tokens are removed.
  • Use case: A macOS smart card authentication extension that reads PIV certificates, enforces PIN verification via secure PIN interactions, and exposes signing keys to the system for login and SSO flows.

Quick Start

Use CryptoTokenKit to detect present tokens with TKTokenWatcher, verify tokenIDs, and obtain a SecKey via kSecAttrTokenID before performing cryptographic operations.

Frequently Asked Questions about cryptotokenkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a macOS token driver extension for smart cards?

To build a macOS token driver extension, implement TKSmartCardTokenDriver and TKToken subclasses to expose token keys and certificates to the system. This populates keychain items with proper objectIDs and capabilities, enabling system-wide smart card authentication.

How does smart card APDU communication work with CryptoTokenKit?

Smart card APDU communication involves opening secure TKSmartCard sessions, sending APDU commands to the token, and safely interpreting status words. You must handle chained responses properly to ensure reliable cryptographic operations and avoid protocol errors.

Does CryptoTokenKit support NFC smart card sessions on iOS?

Yes, CryptoTokenKit supports NFC smart card sessions on supported iOS devices. This allows mobile applications to establish secure connections with NFC hardware tokens for client-side cryptographic authentication and data access.

How do I implement PIN verification for token sessions?

Implement PIN verification by using TKTokenSession and TKTokenSessionDelegate to enforce standard or secure PIN interactions. This ensures algorithm capability checks are performed, preventing unsupported cryptographic operations and protecting token access.

What is the best way to detect present hardware tokens on macOS?

The best way to detect present hardware tokens is using TKTokenWatcher to monitor token insertion and removal. You can verify tokenIDs and obtain a SecKey via kSecAttrTokenID-filtered keychain lookups before performing any client-side cryptographic operations.