@Plumenator You can search for a Keychain element later, and in the search dictionary, specify the value kCFBooleanTrue for the key kSecReturnPersistentRef . If an item is found, Keychain Services returns a permalink to it. If SecItemAdd() successfully adds an item to the keychain, it will remain there as long as the keychain exists (usually until the device is reset) or SecItemDelete() deletes it.
To answer the second question: the key kSecReturnPersistentRef is called a return type key, because you indicate that the function SecItemAdd() or SecItemCopyMatching() should be returned to you. Possible flags are: kSecReturnPersistentRef , kSecReturnData , kSecReturnAttributes and kSecReturnRef .
source share