As an argument to many of the keychain functions, you can specify a particular keychain. Usually, you will simply use the user’s default keychain. For all of these functions, if you just supply NULL as the keychain, it will use the default keychain. However, if you want to explicitly get the default keychain you use:
OSStatus SecKeychainCopyDefault (SecKeychainRef *keychain)
If you wanted to specify a different keychain (remember that a keychain is just a file), you could use:
OSStatus SecKeychainOpen (const char *pathName, SecKeychainRef *keychain)
When you are done with a keychain, make sure that you call CFRelease() to free it.