On this page
Overview
KeychainAccess is a Swift wrapper around Security framework Keychain APIs. It stores and retrieves application or internet passwords and also exposes access groups, accessibility, iCloud synchronization, and Touch ID/Face ID protection through a fluent interface.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Store and retrieve String or Data values in service- or server-scoped keychains
Keychain(service:) and Keychain(server:protocolType:) can use subscripts or set/get methods to persist credentials. This provides a small Swift API for moving tokens and passwords into Keychain rather than general application storage.
Sources: [2]
Configure accessibility, sharing, iCloud synchronization, and biometric policies
Accessibility, accessGroup, synchronizable, and authenticationPolicy settings can define how items are protected and shared. Face ID requires NSFaceIDUsageDescription, and the README warns that operations requiring authentication should run off the main thread.
Sources: [2]
Best fit
Fits iOS applications that keep tokens, credentials, and device secrets in Keychain
It is useful when applications need to store login tokens, API credentials, or device-specific secrets without spreading low-level Security framework calls throughout application code.
Sources: [2]
Before adoption
The latest release is from 2021, so verify it against current Swift and Xcode
The latest GitHub release is v4.2.2 from March 2021. Its Package.swift uses Swift tools 5.0 and declares iOS 8+. The repository was last pushed in May 2024, so current Swift/Xcode builds, strict-concurrency diagnostics, deployment settings, and runtime behavior should be verified before adoption.
Official sources
- [1]kishikawakatsumi/KeychainAccess — GitHub repository(2026-10-06)
- [2]KeychainAccess v4.2.2 — README(2026-10-06)
- [3]KeychainAccess v4.2.2 — Package.swift(2026-10-06)
- [4]KeychainAccess v4.2.2 release(2026-10-06)
- [5]KeychainAccess MIT license(2026-10-06)
Supplemental curator note
KeychainAccess fits iOS applications that store tokens and credentials in Keychain without directly using low-level Security framework APIs. The latest release is from 2021, so verify current Swift/Xcode builds and runtime behavior before adoption.
Try it in 3 steps
- 1
Add KeychainAccess 4.2.2 with SwiftPM
Pin the latest GitHub release. Because the release is old, verify it builds with the current Swift and Xcode toolchain first.
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", exact: "4.2.2") - 2
Create a service-scoped Keychain
Create a Keychain wrapper scoped to the application credential service.
import KeychainAccess let keychain = Keychain(service: "com.example.app") - 3
Store and read an access token
Use the set/get methods and confirm the credential path is backed by Keychain instead of general application storage.
try keychain.set("token-value", key: "accessToken") let token = try keychain.get("accessToken")
Growth
Growth trends · Last 30 days
8,253 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 6
Development activity is still being collected.
Built with
Categories and tags
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- keychain
- touch-id
- security
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- SwiftUI Introspect6,559 Stars
3 shared tag(s) · 1 shared category(s) · Same language
access the UIKit or AppKit components underneath SwiftUI views through public APIs
Swift - DeviceKit4,733 Stars
3 shared tag(s) · 1 shared category(s) · Same language
augment UIDevice with value-typed device models, simulator detection, battery state, and hardware capabilities
Swift - Apollo iOS4,037 Stars
3 shared tag(s) · 1 shared category(s) · Same language
generate type-safe Swift models from GraphQL and combine queries with normalized caching
Swift - Flutter179,343 Stars
3 shared tag(s) · 1 shared category(s)
build mobile, web, and desktop UI from one Dart codebase
Dart - React Native126,797 Stars
3 shared tag(s) · 1 shared category(s)
native mobile UI with React, stable 0.87.1, and a framework-first path
C++ - Expo52,566 Stars
3 shared tag(s) · 1 shared category(s)
build React Native apps for Android, iOS, and web from one project model
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.