0

I'm really new wit iOS keychain and stumbled upon this framework called UICKeyChainStore here. I also saw a tutorial using the above mentioned framework on sharing your keychain across several apps here.

In the framework site the developer mentions about saving to the keychain with this syntax:

[UICKeyChainStore setString:@"kishikawakatsumi" forKey:@"username" service:@"com.kishikawakatsumi"];

[UICKeyChainStore setString:@"password1234" forKey:@"password" service:@"com.kishikawakatsumi"];

Does that mean it stores the username and password separately? So how do i retrieve the username and password of the same person? I am clueless to GitHub environment. Tried looking for a forum on that particular framework in GitHub but couldn't find any. Hoping stackoverflow could shed some light on this matter...

Thanx in advance...

Joe Shamuraq
  • 1,245
  • 3
  • 18
  • 32

1 Answers1

1

After saving the values to the keychain, you should be able to retrieve them like this:

NSString *username = [UICKeyChainStore stringForKey:@"username" service:@"com.kishikawakatsumi"];
NSString *password = [UICKeyChainStore stringForKey:@"password" service:@"com.kishikawakatsumi"];
lottscarson
  • 578
  • 5
  • 14
  • Can i do this when assigning to keychain: e.g.; `[UICKeyChainStore setString:@"password1234" forKey:@"michael" service:@"com.kishikawakatsumi"];`? In that way i just need to call for key 'michael' for the password? – Joe Shamuraq Mar 27 '13 at 16:10
  • I haven't actually used UICKeyChainStore, but yeah, it looks like accessor methods for retrieving stored values are the various stringForKey: and dataForKey: methods. – lottscarson Mar 27 '13 at 16:15
  • Another thing... If i use KeyChain, does it mean i have to declare it as using cryptography during submission to iTunesconnect? – Joe Shamuraq Mar 27 '13 at 16:22
  • go through this http://stackoverflow.com/questions/5609259/adding-encryption-to-an-iphone-app-how-does-it-affect-approval OR this http://stackoverflow.com/questions/2128927/using-ssl-in-an-iphone-app-export-compliance and this http://tigelane.blogspot.in/2011/01/apple-itunes-export-restrictions-on.html – Suny Mar 28 '13 at 04:02