Updates an existing keychain item after changing its attributes and/or data.
- macOS 10.2+
A reference to the keychain item to modify.
A pointer to the list of attributes to set and their new values. Pass
NULLif you have no need to modify attributes.
The length of the buffer pointed to by the
0if you pass
A pointer to a buffer containing the data to store. Pass
NULLif you do not need to modify the data.
A result code. See Security Framework Result Codes.
The keychain item is written to the keychain’s permanent data store.
If the keychain item has not previously been added to a keychain, a call to this function does nothing and returns
Note that when you use this function to modify a keychain item, Keychain Services updates the modification date of the item. Therefore, you cannot use this function to modify the modification date, as the value you specify will be overwritten with the current time. If you want to change the modification date to something other than the current time, use a CSSM function to do so.
You should pair the
Sec function with the
Sec function when dealing with older Keychain Manager functions. The
Sec functions handle more attributes than are support by the old Keychain Manager; however, passing them into older calls yields an invalid attribute error.