Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving any object to Keychain

I want to save an object which might include sensitive data into the keychain. To achieve this i will convert this object into a NSData instance.

I'm a bit confused which attributes i need to use. Is it ok to use kSecClassGenericPassword as kSecClass even though it is not really a password? Furthermore i've set the kSecAttrAccount. I've read somewhere that i also need to add kSecAttrService. What implications can happen if i don't ?

like image 450
kukudas Avatar asked Nov 13 '22 03:11

kukudas


1 Answers

Checkout SSKeychain on GitHub. It's a nice Open Source wrapper for the keychain that makes it super easy to use. If you want to understand more about how the keychain and the security on iOS/OS X work and you're registered to the Apple Developer Program, there are few WWDC session videos that you might check on developer.apple.com.

like image 165
Gianluca Tranchedone Avatar answered Nov 15 '22 05:11

Gianluca Tranchedone