Skip to content

Yubico/yubikit-swift

Repository files navigation

YubiKit Swift SDK

Swift 6.1 Platforms SPM Compatible Documentation License

Swift SDK for YubiKey integration on iOS and macOS.

Overview

YubiKit provides a native Swift interface with async/await for YubiKey hardware devices.

let connection = try await NFCSmartCardConnection.makeConnection()
let session = try await OATHSession.makeSession(connection: connection)
let codes = try await session.calculateCodes()
await connection.close(message: "Done")

About

YubiKit uses a layered architecture where the connection layer handles communication via NFC, Lightning, and USB-C, while application-specific sessions are built on top of these connections. All APIs use modern Swift async/await concurrency patterns for clean, readable code.

Supported Applications

OATH - Configure and use TOTP/HOTP credentials for two-factor authentication

PIV - Smart card functionality including X.509 certificate management, key generation (RSA, ECDSA, Curve25519), and cryptographic operations

Management - Read YubiKey metadata (serial number, firmware version) and configure device settings

Secure Channel Protocol - SCP03 and SCP11 for encrypted communication

Installation

Swift Package Manager

https://github.com/Yubico/yubikit-swift

Documentation

Sample Apps

Learn by example:

Requirements

  • iOS 16.0+ / macOS 13.0+

Security Notice

This SDK does not perform zeroization of sensitive data in memory. Cryptographic keys, PIN tokens, and other secrets are not securely erased when no longer in use. This is currently out of scope but may be addressed in a future release.

Support

License

Apache License 2.0

About

Yubico Swift SDK - YubiKit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages