Global Variable

kSecUseDataProtectionKeychain

A key whose value indicates whether to treat macOS keychain items like iOS keychain items.

Declaration

const CFStringRef kSecUseDataProtectionKeychain;

Discussion

Set the value for this key to true in the query dictionary when accessing a macOS keychain item that behaves like an iOS keychain item. For example, use the data protection key when adding, searching for, or deleting an item to which the kSecAttrAccessible or kSecAttrAccessGroup attributes apply.

The data protection key affects operations only in macOS. Other platforms automatically behave as if the key is set to true, and ignore the key in the query dictionary. You can safely use the key on all platforms.

Items that you store or have stored in macOS with the kSecAttrSynchronizable attribute set to true also behave like iOS keychain items. However, a true value for that attribute additionally causes iCloud to synchronize the item across all the user’s devices. Use kSecUseDataProtectionKeychain to get the iOS behavior without synchronization.

See Also

Additional Item Search Keys

kSecUseItemList

A key whose value is an array of items to search.

kSecUseKeychain

A key whose value is a keychain to operate on.

kSecUseOperationPrompt

A key whose value is an operation prompt.

kSecUseNoAuthenticationUI

A key whose value is a Boolean indicating whether to disallow UI authentication.

Deprecated
kSecUseAuthenticationUI

A key whose value indicates whether the user may be prompted for authentication.

kSecUseAuthenticationContext

A key whose value indicates a local authentication context to use.