Securely store Username and Password using keychain

Hi, Today I demonstrate how to store username/password into Keychain and how to access from keychain Using Keychain Service. The Keychain Services API provides a solution to this problem. By making a single call to this API, an application can store login information on a keychain where the application can retrieve the information—also with a single call—when needed. Akeychain is an encrypted container that holds passwords for multiple applications and secure services. Keychains are secure storage containers, which means that when the keychain is locked, no one can access its protected contents. In OS X, users can unlock a keychain—thus providing trusted applications access to the contents—by entering a single master password. In iOS, each application always has access to its own keychain items; the user is never asked to unlock the keychain. Whereas in OS X any application can access any keychain item provided the user gives permission, in iOS an application can access only its own keychain items.

Adding security framework

For Store data

For Retrieve data

For Remove all credentials

Here is the Link for apple official Keychain store example.

Leave a Reply

Your email address will not be published. Required fields are marked *



*