Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated to version 1.2

  • Loading branch information...
commit 761dbc150c8ca2e4fb92c8d76713de29768c7d27 1 parent 5f192d2
@nicklockwood authored
View
10 Examples/Advanced Example/FXKeychainExample/ViewController.m
@@ -14,7 +14,6 @@ @interface ViewController () <UITextFieldDelegate, UITextViewDelegate>
@property (nonatomic, strong) FXKeychain *keychain;
-@property (nonatomic, weak) IBOutlet UITextField *accountField;
@property (nonatomic, weak) IBOutlet UITextField *serviceField;
@property (nonatomic, weak) IBOutlet UITextField *accessGroupField;
@@ -32,8 +31,7 @@ - (void)viewDidLoad
//get settings from NSUserDefaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- _accountField.text = [defaults objectForKey:@"account"] ?: @"default";
- _serviceField.text = [defaults objectForKey:@"service"] ?: @"default";
+ _serviceField.text = [defaults objectForKey:@"service"] ?: [[NSBundle mainBundle] bundleIdentifier];
_accessGroupField.text = [defaults objectForKey:@"accessGroup"];
_keyField.text = [defaults objectForKey:@"key"] ?: @"password";
@@ -45,17 +43,16 @@ - (void)saveSettings
{
//preserve settings in NSUserDefaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- [defaults setObject:_accountField.text forKey:@"account"];
[defaults setObject:_serviceField.text forKey:@"service"];
[defaults setObject:_accessGroupField.text forKey:@"accessGroup"];
[defaults setObject:_keyField.text forKey:@"key"];
+ [defaults synchronize];
}
- (void)updateKeychainFromFields
{
//create keychain
- _keychain = [[FXKeychain alloc] initWithAccount:_accountField.text
- service:_serviceField.text
+ _keychain = [[FXKeychain alloc] initWithService:_serviceField.text
accessGroup:_accessGroupField.text];
}
@@ -94,7 +91,6 @@ - (IBAction)delete
- (IBAction)tap
{
- [_accountField resignFirstResponder];
[_serviceField resignFirstResponder];
[_accessGroupField resignFirstResponder];
[_keyField resignFirstResponder];
View
141 Examples/Advanced Example/FXKeychainExample/en.lproj/ViewController.xib
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
- <int key="IBDocument.SystemTarget">1536</int>
- <string key="IBDocument.SystemVersion">12C3012</string>
- <string key="IBDocument.InterfaceBuilderVersion">2844</string>
- <string key="IBDocument.AppKitVersion">1187.34</string>
- <string key="IBDocument.HIToolboxVersion">625.00</string>
+ <int key="IBDocument.SystemTarget">1552</int>
+ <string key="IBDocument.SystemVersion">12D78</string>
+ <string key="IBDocument.InterfaceBuilderVersion">3084</string>
+ <string key="IBDocument.AppKitVersion">1187.37</string>
+ <string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">1930</string>
+ <string key="NS.object.0">2083</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
@@ -39,20 +39,20 @@
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
- <object class="IBUILabel" id="35689451">
+ <object class="IBUILabel" id="445052618">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 20}, {62, 21}}</string>
+ <string key="NSFrame">{{20, 22}, {57, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="818338509"/>
+ <reference key="NSNextKeyView" ref="1040392897"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <string key="IBUIText">Account</string>
+ <string key="IBUIText">Service</string>
<object class="NSColor" key="IBUITextColor" id="65806915">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
@@ -64,38 +64,17 @@
<int key="type">1</int>
<double key="pointSize">15</double>
</object>
- <object class="NSFont" key="IBUIFont" id="850344025">
+ <object class="NSFont" key="IBUIFont" id="76311576">
<string key="NSName">Helvetica</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
- <object class="IBUILabel" id="445052618">
- <reference key="NSNextResponder" ref="774585933"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 63}, {57, 21}}</string>
- <reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="1040392897"/>
- <string key="NSReuseIdentifierKey">_NS:9</string>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <int key="IBUIContentMode">7</int>
- <bool key="IBUIUserInteractionEnabled">NO</bool>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <string key="IBUIText">Service</string>
- <reference key="IBUITextColor" ref="65806915"/>
- <nil key="IBUIHighlightedColor"/>
- <int key="IBUIBaselineAdjustment">0</int>
- <reference key="IBUIFontDescription" ref="685696947"/>
- <reference key="IBUIFont" ref="850344025"/>
- <bool key="IBUIAdjustsFontSizeToFit">NO</bool>
- </object>
<object class="IBUILabel" id="97260464">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 109}, {55, 21}}</string>
+ <string key="NSFrame">{{20, 68}, {55, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="489861085"/>
@@ -110,13 +89,13 @@
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<reference key="IBUIFontDescription" ref="685696947"/>
- <reference key="IBUIFont" ref="850344025"/>
+ <reference key="IBUIFont" ref="76311576"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="814592518">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 189}, {30, 21}}</string>
+ <string key="NSFrame">{{20, 144}, {30, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="370229739"/>
@@ -131,22 +110,22 @@
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<reference key="IBUIFontDescription" ref="685696947"/>
- <reference key="IBUIFont" ref="850344025"/>
+ <reference key="IBUIFont" ref="76311576"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
- <object class="IBUITextField" id="818338509">
+ <object class="IBUITextField" id="1040392897">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">290</int>
- <string key="NSFrame">{{90, 17}, {210, 30}}</string>
+ <string key="NSFrame">{{90, 19}, {210, 30}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="445052618"/>
+ <reference key="NSNextKeyView" ref="97260464"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
- <string key="IBUIText">default</string>
+ <string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
@@ -164,43 +143,16 @@
<int key="type">1</int>
<double key="pointSize">14</double>
</object>
- <object class="NSFont" key="IBUIFont" id="520452647">
+ <object class="NSFont" key="IBUIFont" id="104901708">
<string key="NSName">Helvetica</string>
<double key="NSSize">14</double>
<int key="NSfFlags">16</int>
</object>
</object>
- <object class="IBUITextField" id="1040392897">
- <reference key="NSNextResponder" ref="774585933"/>
- <int key="NSvFlags">290</int>
- <string key="NSFrame">{{90, 60}, {210, 30}}</string>
- <reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="97260464"/>
- <string key="NSReuseIdentifierKey">_NS:9</string>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <int key="IBUIContentVerticalAlignment">0</int>
- <string key="IBUIText">default</string>
- <int key="IBUIBorderStyle">3</int>
- <object class="NSColor" key="IBUITextColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MAA</bytes>
- <reference key="NSCustomColorSpace" ref="124487435"/>
- </object>
- <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
- <float key="IBUIMinimumFontSize">17</float>
- <object class="IBUITextInputTraits" key="IBUITextInputTraits">
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- </object>
- <reference key="IBUIFontDescription" ref="831298535"/>
- <reference key="IBUIFont" ref="520452647"/>
- </object>
<object class="IBUITextField" id="489861085">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">290</int>
- <string key="NSFrame">{{90, 105}, {210, 30}}</string>
+ <string key="NSFrame">{{90, 64}, {210, 30}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="814592518"/>
@@ -222,12 +174,12 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIFontDescription" ref="831298535"/>
- <reference key="IBUIFont" ref="520452647"/>
+ <reference key="IBUIFont" ref="104901708"/>
</object>
<object class="IBUITextField" id="370229739">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">290</int>
- <string key="NSFrame">{{90, 185}, {210, 30}}</string>
+ <string key="NSFrame">{{90, 140}, {210, 30}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="496754924"/>
@@ -249,12 +201,12 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIFontDescription" ref="831298535"/>
- <reference key="IBUIFont" ref="520452647"/>
+ <reference key="IBUIFont" ref="104901708"/>
</object>
<object class="IBUILabel" id="496754924">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 230}, {36, 21}}</string>
+ <string key="NSFrame">{{20, 185}, {36, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="916830202"/>
@@ -269,13 +221,13 @@
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<reference key="IBUIFontDescription" ref="685696947"/>
- <reference key="IBUIFont" ref="850344025"/>
+ <reference key="IBUIFont" ref="76311576"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUITextView" id="916830202">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">274</int>
- <string key="NSFrame">{{90, 230}, {210, 152}}</string>
+ <string key="NSFrame">{{90, 185}, {210, 197}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="955183396"/>
@@ -293,7 +245,7 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIFontDescription" ref="831298535"/>
- <reference key="IBUIFont" ref="520452647"/>
+ <reference key="IBUIFont" ref="104901708"/>
</object>
<object class="IBUIButton" id="955183396">
<reference key="NSNextResponder" ref="774585933"/>
@@ -360,7 +312,6 @@
<string key="NSFrame">{{220, 397}, {80, 44}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -381,7 +332,7 @@
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="35689451"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC43NQA</bytes>
@@ -423,14 +374,6 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">accountField</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="818338509"/>
- </object>
- <int key="connectionID">129</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">serviceField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="1040392897"/>
@@ -474,14 +417,6 @@
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
- <reference key="source" ref="818338509"/>
- <reference key="destination" ref="372490531"/>
- </object>
- <int key="connectionID">138</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">delegate</string>
<reference key="source" ref="1040392897"/>
<reference key="destination" ref="372490531"/>
</object>
@@ -570,10 +505,8 @@
<int key="objectID">6</int>
<reference key="object" ref="774585933"/>
<array class="NSMutableArray" key="children">
- <reference ref="35689451"/>
<reference ref="445052618"/>
<reference ref="97260464"/>
- <reference ref="818338509"/>
<reference ref="1040392897"/>
<reference ref="489861085"/>
<reference ref="814592518"/>
@@ -587,12 +520,6 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">12</int>
- <reference key="object" ref="35689451"/>
- <array class="NSMutableArray" key="children"/>
- <reference key="parent" ref="774585933"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="445052618"/>
<reference key="parent" ref="774585933"/>
@@ -603,12 +530,6 @@
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">21</int>
- <reference key="object" ref="818338509"/>
- <array class="NSMutableArray" key="children"/>
- <reference key="parent" ref="774585933"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="1040392897"/>
<array class="NSMutableArray" key="children"/>
@@ -675,11 +596,9 @@
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="103.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="109.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="143.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="35.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="42.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -740,6 +659,6 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">1930</string>
+ <string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>
View
6 FXKeychain/FXKeychain.h
@@ -1,7 +1,7 @@
//
// FXKeychain.h
//
-// Version 1.1
+// Version 1.2
//
// Created by Nick Lockwood on 29/12/2012.
// Copyright 2012 Charcoal Design
@@ -39,12 +39,10 @@
+ (instancetype)defaultKeychain;
-@property (nonatomic, copy, readonly) NSString *account;
@property (nonatomic, copy, readonly) NSString *service;
@property (nonatomic, copy, readonly) NSString *accessGroup;
-- (id)initWithAccount:(NSString *)account
- service:(NSString *)service
+- (id)initWithService:(NSString *)service
accessGroup:(NSString *)accessGroup;
- (BOOL)setObject:(id<NSCoding>)object forKey:(id<NSCopying>)key;
View
19 FXKeychain/FXKeychain.m
@@ -1,7 +1,7 @@
//
// FXKeychain.m
//
-// Version 1.1
+// Version 1.2
//
// Created by Nick Lockwood on 29/12/2012.
// Copyright 2012 Charcoal Design
@@ -48,8 +48,7 @@ + (instancetype)defaultKeychain
if (!sharedInstance)
{
NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
- sharedInstance = [[FXKeychain alloc] initWithAccount:@"default"
- service:bundleID
+ sharedInstance = [[FXKeychain alloc] initWithService:bundleID
accessGroup:nil];
}
return sharedInstance;
@@ -57,16 +56,14 @@ + (instancetype)defaultKeychain
- (id)init
{
- return [self initWithAccount:nil service:nil accessGroup:nil];
+ return [self initWithService:nil accessGroup:nil];
}
-- (id)initWithAccount:(NSString *)account
- service:(NSString *)service
+- (id)initWithService:(NSString *)service
accessGroup:(NSString *)accessGroup
{
if ((self = [super init]))
{
- _account = [account copy];
_service = [service copy];
_accessGroup = [accessGroup copy];
}
@@ -77,10 +74,9 @@ - (BOOL)setObject:(id<NSCoding>)object forKey:(id<NSCopying>)key
{
//generate query
NSMutableDictionary *query = [NSMutableDictionary dictionary];
- if ([_account length]) query[(__bridge NSString *)kSecAttrAccount] = _account;
if ([_service length]) query[(__bridge NSString *)kSecAttrService] = _service;
query[(__bridge NSString *)kSecClass] = (__bridge id)kSecClassGenericPassword;
- query[(__bridge NSString *)kSecAttrGeneric] = key;
+ query[(__bridge NSString *)kSecAttrAccount] = key;
#if defined __IPHONE_OS_VERSION_MAX_ALLOWED && !TARGET_IPHONE_SIMULATOR
if ([_accessGroup length]) query[(__bridge NSString *)kSecAttrAccessGroup] = _accessGroup;
@@ -92,7 +88,7 @@ - (BOOL)setObject:(id<NSCoding>)object forKey:(id<NSCopying>)key
{
data = [(NSString *)object dataUsingEncoding:NSUTF8StringEncoding];
}
- else
+ else if (object)
{
data = [NSKeyedArchiver archivedDataWithRootObject:object];
}
@@ -138,12 +134,11 @@ - (id)objectForKey:(id<NSCopying>)key
{
//generate query
NSMutableDictionary *query = [NSMutableDictionary dictionary];
- if ([_account length]) query[(__bridge NSString *)kSecAttrAccount] = _account;
if ([_service length]) query[(__bridge NSString *)kSecAttrService] = _service;
query[(__bridge NSString *)kSecClass] = (__bridge id)kSecClassGenericPassword;
query[(__bridge NSString *)kSecMatchLimit] = (__bridge id)kSecMatchLimitOne;
query[(__bridge NSString *)kSecReturnData] = (__bridge id)kCFBooleanTrue;
- query[(__bridge NSString *)kSecAttrGeneric] = key;
+ query[(__bridge NSString *)kSecAttrAccount] = key;
#if defined __IPHONE_OS_VERSION_MAX_ALLOWED && !TARGET_IPHONE_SIMULATOR
if ([_accessGroup length]) query[(__bridge NSString *)kSecAttrAccessGroup] = _accessGroup;
View
2  LICENCE.md
@@ -1,6 +1,6 @@
FXKeychain
-Version 1.1, December 30th, 2012
+Version 1.2, March 21st, 2013
Copyright (C) 2012 Charcoal Design
View
15 README.md
@@ -3,7 +3,7 @@ Purpose
FXKeychain is a lightweight wrapper around the Apple keychain APIs that exposes the commonly used functionality whilst hiding the horrific complexity and ugly interface of the underlying APIs.
-FXKeychain treats the keychain like a simple dictionary that you can set and get values from. For most purposes you can get by using the defaultKeychain, however it is also possible to create new keychain instances if you wish to namespace your keychain by account/service, or share values between apps using an accessGroup.
+FXKeychain treats the keychain like a simple dictionary that you can set and get values from. For most purposes you can get by using the defaultKeychain, however it is also possible to create new keychain instances if you wish to namespace your keychain by service, or share values between apps using an accessGroup.
Supported iOS & SDK Versions
@@ -34,11 +34,7 @@ Properties
------------------
FXKeychain has the following properties. They are all immutable once the keychain has been created.
-
- @property (nonatomic, copy, readonly) NSString *account;
-
-The account property is used to distinguish between multiple user accounts within the same app. If the app supports multiple users, you might use their username or another user-specific identifer for the account value.
-
+
@property (nonatomic, copy, readonly) NSString *service;
The service property is used to distinguish between multiple apps or services on a given device or within the same app. On Mac OS and the iOS simulator, services are shared between apps, so it's a good idea to use something unique for the service, such as the application bundle ID, or the same value as the accessGroup if you wish to share a service between multiple apps.
@@ -53,13 +49,12 @@ Methods
+ (instancetype)defaultKeychain;
-This method returns a shared default keychain instance, which has the value @"default" for the account and uses the app's bundle ID for the service to avoid namespace collisions with other apps on Mac OS or the iOS simulator.
+This method returns a shared default keychain instance, which uses the app's bundle ID for the service to avoid namespace collisions with other apps on Mac OS or the iOS simulator.
- - (id)initWithAccount:(NSString *)account
- service:(NSString *)service
+ - (id)initWithService:(NSString *)service
accessGroup:(NSString *)accessGroup;
-This method creates a new FXKeychain instance with the specified parameters. Each FXKeychain can contain as many key/value pairs as you want, so you may only need a single FXKeychain per application. Each FXKeychain is uniquely identified by the account and service parameters; see the Properties description for how to use these. You can specify nil for the account and/or service values, in which case they will act as "wildcard" selectors and calls to objectForKey: will return the first value found within any account/service pair. The accessGroup parameter is used for setting up shared keychains that can be accessed by multiple different apps; leave this as nil if you do not require that functionality.
+This method creates a new FXKeychain instance with the specified parameters. Each FXKeychain can contain as many key/value pairs as you want, so you may only need a single FXKeychain per application. Each FXKeychain is uniquely identified by the service parameter; see the Properties description for how to use this. You can specify nil for the service, in which case it will act as "wildcard" selector and calls to objectForKey: will return the first value found within any service stored in the keychain. The accessGroup parameter is used for setting up shared keychains that can be accessed by multiple different apps; leave this as nil if you do not require that functionality.
- (BOOL)setObject:(id<NSCoding>)object forKey:(id<NSCopying>)key;
- (BOOL)setObject:(id<NSCoding>)object forKeyedSubscript:(id<NSCopying>)key;
View
5 RELEASE NOTES.md
@@ -1,3 +1,8 @@
+Version 1.2
+
+- It is now possible to actually store more than one value per FXKeychain
+- Removed account parameter (it didn't work the way I thought)
+
Version 1.1
- Now uses application bundle ID to namespace the default keychain
Please sign in to comment.
Something went wrong with that request. Please try again.