Skip to content

Instantly share code, notes, and snippets.

View jshier's full-sized avatar

Jon Shier jshier

  • Detroit Labs
  • Rochester Hills, MI
View GitHub Profile
@jshier
jshier / gist:7235282
Created October 30, 2013 16:06
A simple programming sample using the keychain APIs and checking clipboard contents.
NSDictionary *query = @{(id)kSecClass : (id)kSecClassGenericPassword,
(id)kSecAttrService : @"HazeLight: CloudFlare API Key",
(id)kSecReturnAttributes : @YES,
(id)kSecReturnData : @YES};
NSDictionary *item = NULL;
CFTypeRef result = (__bridge CFTypeRef)item;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result);
item = (NSDictionary *)CFBridgingRelease(result);
if (status == errSecSuccess)