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

Searching for Items

Attribute lists are used in three ways:

  1. to specify a search for items.

  2. to read data from an item.

  3. to set the data for an item.

For example, to create a search for all generic passwords that have bignerdranch as the account name, you would create an attribute list and invoke SecKeychainSearchCreateFromAttributes().

OSStatus SecKeychainSearchCreateFromAttributes (CFTypeRef  keychainOrArray,
                                             SecItemClass  itemClass, 
                           const SecKeychainAttributeList *attrList, 
                                     SecKeychainSearchRef *searchRef);

Most of the functions in the Security framework deal well with NULLs. They do what you would hope. For example, if you pass NULL as the first argument, the search will check all the user’s normal keychains. Usually, this is what you want. For the ...

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