Keychain Access

Each keychain item defines how it may be accessed. The information about access privileges is kept in a SecAccessRef structure. To get the access structure for a particular keychain item, you use the following function:

OSStatus SecKeychainItemCopyAccess (SecKeychainItemRef  item,
                                    SecAccessRef *access);

To change the access on a keychain item, you edit the SecAccessRef and write it to the keychain item using:

OSStatus SecKeychainItemSetAccess (SecKeychainItemRef item, 
                                   SecAccessRef access);

What, then, is a SecAccessRef? You can get a list of access control lists (ACLs) from it. Each access list has a list of trusted applications that are allowed to access the keychain item. Some applications can access the keychain item only ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.