O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required