Creates a new keychain item from the supplied parameters.
- macOS 10.2+
A constant identifying the class of item to create. See
Secfor valid constants.
A pointer to the list of attributes for the item to create.
The length of the buffer pointed to by the
A pointer to a buffer containing the data to store.
A reference to the keychain in which to add the item. Pass
NULLto specify the default keychain.
On return, a pointer to a reference to the newly created keychain item. This parameter is optional. You must call the
CFReleasefunction to release this object when you are finished using it.
A result code. See Security Framework Result Codes.
Each item stored in the keychain contains data (such as a certificate), which is indexed by the item’s attributes. Use this function to create a keychain item from its attributes and data. To create keychain items that hold passwords, use the
Sec object for a certificate that is stored in a keychain can be safely cast to a
Sec for use with the Certificate, Key, and Trust API.
This function automatically calls the function
Sec to display the Unlock Keychain dialog box if the keychain is currently locked.