Skip to content

A thin Keychain Services wrapper Framework, multi-target (defaults to macOS) in Swift.

Notifications You must be signed in to change notification settings

RobertoMachorro/SecureStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecureStore

Version Carthage compatible

This is yet another Keychain Services wrapper - queue the eye roll. I tried out quite a number, they felt overly abstracted, underimplemented or confusing. Even Apple has one. I liked Sam Soffes' SAMKeychain, but it only supports kSecClassGenericPassword. In particular, I was looking for kSecClassInternetPassword. SecureStore supports both very well and can expand to other types (certificates, keys, identities, etc).

The goal was to pickup a good project and adapt it as necessary, I don't like to re-invent wheels, and found one written by Lorenzo Boaro, it's part of RayWenderlich.com tutorial Keychain Services API Tutorial for Passwords in Swift. Unfortunately, neither the author nor the project where on GitHub. Also, the project - while written multiplatform - only targeted iOS. I highly recommend Lorenzo's post, it describes the Keychain operation very well.

So this code / Framework starts where its predecessor left off, by taking the pristine sources and enhancing / adapting for real life Framework usage. Please note that the original copyright and permission has been kept, as requested by the author. If you are interested in the process and adapting of the code, take a look at the commit log.

Adding To Your Project

Swift Package Manager is in the works. Right now Carthage is the way to go:

github "RobertoMachorro/SecureStore"

Check the tests for call examples, most are very atomic.

Project Status

Currently, the project is ready to use and defaults to macOS builds.

Pending

  • iOS Target
  • macOS and passes all but 2 tests. The original source passes all tests under iOS.

Changes from Original Source

  • Independent project and framework with shared schema for Carthage
  • Public Queryable structs initializers

Contributing

Feel free to fork a copy and create a pull request.

Documentation

Both API documentation and examples plus a patient description of Keychain Services can be found at Keychain Services API Tutorial for Passwords in Swift.