SecIdentitySearchCreate
Creates a search object for finding identities.
Declaration
OSStatus SecIdentitySearchCreate(CFTypeRef keychainOrArray, CSSM_KEYUSE keyUsage, SecIdentitySearchRef*searchRef);Parameters
- keychainOrArray:
A keychain object for a single keychain to search, an array of keychain objects for a set of keychains to search, or
NULLto search the user’s default keychain search list. - keyUsage:
A CSSM key use value as defined in
Security.framework/cssmtype.h. (Note that, because key recovery is not implemented, theSIGN_RECOVERandVERIFY_RECOVERconstants are not supported.) Use this parameter to filter the search by specifying the key use for the identity. Pass0if you want all identities returned by this search. PassCSSM_KEYUSE_ANYto limit the identities returned to those that can be used for every operation. - searchRef:
On return, points to the identity search object. In Objective-C, call the Cfrelease function to release this object when you are done with it.
Return Value
A result code. See Security Framework Result Codes.
Discussion
You can OR CSSM_KEYUSE values together to set more than one value for key use. Use the returned search object in calls to the SecIdentitySearchCopyNext function to obtain identities that match the search criteria.