Store and retrieve user data in iOS keychain

I am developing an application in which I need to store and retrieve user data, such as (username, password, URL, domain name, etc.) using keychain. But I found there predefined keys, for example, (kSecAttrAccount, kSecAttrDescription, kSecAttrComment, kSecValueData, etc.). I used to use Plist to store this information.

So who can help me how to use the keychain for storage.

I looked at the apple sample project, which is used only for login and password.

Can I use a dictionary (containing all user data) to setobject in the key chain and get the dictionary from it.

thanks

+4
source share
1 answer

I created a very simple wrapper around Keychain. It is very similar to NSDictionary with setValue and objectForKey methods.

https://github.com/reidmain/FDKeychain

+2
source

Source: https://habr.com/ru/post/1401344/


All Articles