EMKeychain : Download v0.14

What Is EMKeychain?

EMKeychain is a Cocoa wrapper class for Keychain, which has unfortunately been frozen in carbonite. It's much cleaner than interfacing with keychain yourself.

How Advanced Is EMKeychain?

It's usable in what we expect to be most scenarios. It's very basic right now considering the girth of Keychain itself, so we'll be evolving it with time as necessary. We recommend you check out the class overview to properly see if you should use EMKeychain in your project.

Usage

Adding a generic keychain item


[[EMKeychainProxy sharedProxy] addGenericKeychainItemForService:@"SomeApplicationService" withUsername:@"Joe" password:@"SuperSecure!"];


Adding an internet keychain item


[[EMKeychainProxy sharedProxy] addInternetKeychainItemForServer:@"apple.com" withUsername:@"sjobs" password:@"magic" path:@"/httpdocs/" port:21 protocol:kSecProtocolTypeFTP];


Note that the "protocol" asks for a SecProtocolType.


Working with a keychain item


EMInternetKeychainItem *keychainItem = [[EMKeychainProxy sharedProxy] internetKeychainItemForServer:@"apple.com" withUsername:@"sjobs" path:@"/httpdocs" port:21 protocol:kSecProtocolTypeFTP];


//Get the password

NSString *password = [keychainItem password];


//Change the password and user

[keychainItem setPassword:@"mynewpass"];

[keychainItem setUsername:@"phil"];


Class Overview