Skip to main content

SAMKeychain

A simple, battle-tested wrapper for accessing the system keychain on iOS, macOS, tvOS, and watchOS. Secure password storage made easy.

Why SAMKeychain?

SAMKeychain simplifies working with the system keychain, abstracting away the complexity of Apple’s Security framework while maintaining full control and security.

Simple API

Clean class methods for common operations like storing, retrieving, and deleting passwords

Cross-Platform

Works seamlessly across iOS, macOS, tvOS, and watchOS

Secure by Default

Built on Apple’s Security framework with configurable accessibility options

iCloud Sync

Support for iCloud Keychain synchronization across devices

Access Groups

Share keychain items between apps using access groups

Battle-Tested

Over 5,000 stars on GitHub and used by thousands of apps

Quick Example

Example.m
#import <SAMKeychain/SAMKeychain.h>

// Store a password
[SAMKeychain setPassword:@"mySecretPassword" 
              forService:@"MyApp" 
                 account:@"user@example.com"];

// Retrieve a password
NSString *password = [SAMKeychain passwordForService:@"MyApp" 
                                             account:@"user@example.com"];

// Delete a password
[SAMKeychain deletePasswordForService:@"MyApp" 
                              account:@"user@example.com"];

Get Started

Installation

Install SAMKeychain using CocoaPods, Carthage, or manually

Quickstart

Get up and running in minutes with our step-by-step guide

API Reference

Explore the complete API documentation

Guides

Learn best practices and advanced techniques