Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa interface to MacOS X Keychain

I've got a bit of Mac code that needs to store, access and update passwords in order to connect users with a web API. The right place to put this information should be the Mac Keychain, but there doesn't seem to be a cocoa interface (see this answer) -- is this still correct?

I've looked at Apple's Keychain documentation, and the API seems incredibly clunky. I can store to it and retrieve records, but anything more complex seems to require a lot of thought as to what might go wrong (see this list of error codes).

Is there a better interface to the Mac keychain, aside from slogging through the C code? The closest I've come is EMKeychain but it seems like it needs a bit of work (e.g. no error handling code aside from spitting to the console).

like image 512
Noah Avatar asked Mar 25 '12 21:03

Noah


People also ask

How do I use macOS X keychain?

Open System Preferences, click the icon for Apple ID, and click the checkbox for Keychain. Then when you browse to a password-protected website, iCloud Keychain will ask if you want to save the password. Click Save Password and it'll be securely stored in your Keychain.

Where do I find Keychain Access on my Mac?

The Keychain Access app is located in the Utilities folder in your Applications folder. If you launch it, you'll see a number of items in the sidebar: different keychains, such as Login, and, if you have the iCloud Keychain active (see below), you'll see an entry for that.

What is Keychain Access app on Mac?

Keychain Access is a macOS app that stores your passwords and account information, and reduces the number of passwords you have to remember and manage. When you access a website, email account, network server, or other password-protected item, you may be given the option to remember or save the password.


1 Answers

You should take a look at SSKeychain. Works great, awesome code.

like image 118
sudo rm -rf Avatar answered Sep 19 '22 21:09

sudo rm -rf