TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | CC |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
This project provides a simple, NSUserDefaults
-style interface over the
iOS keychain.
This is currently work in progress.
// Store a secret
[[GSKeychain systemKeychain] setSecret:@"t0ps3kr1t" forKey:@"myAccessToken"];
// Fetch a secret
NSString *secret = [[GSKeychain systemKeychain] secretForKey:@"myAccessToken"];
// Delete a secret
[[GSKeychain systemKeychain] removeSecretForKey:@"myAccessToken"];
// Delete all secrets
[[GSKeychain systemKeychain] removeAllSecrets];
GSKeychain.h
and GSKeychain.m
into your projectimport "GSKeychain.h"
where appropriateGSKeychain uses ARC. If your project doesn't use ARC you could enable it for these files, or use GSArchive as a static library instead.
import "GSKeychain.h"
where appropriateWork inspired by reading Peeking Inside App Bundles by Nick Arnott.
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
You're free to use this code in any project, including commercial. Please include the following text somewhere suitable, e.g. your app's About screen:
Uses GSKeychain by Simon Whitaker