SecKeychainDelete(_:)
Deletes one or more keychains from the default keychain search list, and removes the keychain itself if it is a file.
Declaration
func SecKeychainDelete(_ keychainOrArray: SecKeychain?) -> OSStatusParameters
- keychainOrArray:
A single keychain object or a reference to an array of keychains you wish to delete. To delete more than one keychain, create a
CFArrayof keychain references (typeSecKeychainRef) and pass a reference to the array.In macOS 10.3 and later, passing
NULLto this parameter returns anerrSecInvalidKeychainerror code. In OS X 10.2, this parameter was namedkeychainand only took a single keychain object. PassingNULLto this parameter deleted the user’s default keychain.
Return Value
A result code. See Security Framework Result Codes. The result code errSecInvalidKeychain is returned if the specified keychain is invalid or if the value of the keychainOrArray parameter is invalid or NULL.
Discussion
The keychain may be a file stored locally, a smart card, or retrieved from a network server using non-file-based database protocols. This function deletes the keychain only if it is a local file.
This function does not release the memory used by the keychain object. In Objective-C, call the CFRelease function to release each keychain object when you are finished with it.