Creates an empty keychain.
- macOS 10.2+
A constant character string representing the POSIX path indicating where to store the keychain.
An unsigned 32-bit integer representing the length of the buffer pointed to by
0if the value of
NULLand the value of
A pointer to the buffer containing the password which is used to protect the new keychain. The password must be in canonical UTF-8 encoding. Pass
NULLif the value of
0and the value of
A Boolean value representing whether to display a password dialog to the user. Set this value to
TRUEto display a password dialog or
FALSEotherwise. If you pass
TRUE, any values passed for
passwordare ignored, and a dialog for the user to enter a password is presented.
NULLfor this parameter.
On return, a pointer to a keychain object. You must call the
CFReleasefunction to release this object when you are finished using it.
A result code. See Security Framework Result Codes.
This function creates an empty keychain. The
initial parameters are optional. If user interaction to create a keychain is posted, the newly-created keychain is automatically unlocked after creation.
The system ensures that a default keychain is created for the user at login, thus, in most cases, you do not need to call this function yourself. Users can create additional keychains, or change the default, by using the Keychain Access application. However, a missing default keychain is not recreated automatically, and you may receive an
err error from other functions if a default keychain does not exist. In that case, you can use this function followed by
Sec, to create a new default keychain. You can also call this function to create a private temporary keychain for your application’s use, in cases where no user interaction can occur.