A key whose value is a string indicating whether the item is synchronized through iCloud.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Security
Declaration
const CFString Ref kSecAttrSynchronizable;
Discussion
The corresponding value is of type CFBoolean
and indicates whether the item in question is synchronized to other devices through iCloud. To add a new synchronizable item, or to obtain synchronizable results from a query, supply this key with a value of k
. If the key is not supplied, or has a value of k
, then no synchronizable items are added or returned. Use k
to query for both synchronizable and non-synchronizable results.
A keychain item created in macOS with this attribute behaves like an iOS keychain item. For example, you share the item between apps using Access Groups instead of Access Control Lists. To create a keychain item in macOS that behaves like an iOS keychain item without making it synchronizable, use k
instead.
The following caveats apply when you specify the k
key:
Updating or deleting items using the
k
key will affect all copies of the item, not just the one on your local device. Be sure that it makes sense to use the same password on all devices before making a password synchronizable.Sec Attr Synchronizable Only password items can be synchronized. Keychain syncing is not supported for certificates or cryptographic keys.
Items stored or obtained using the
k
key cannot specifySec Attr Synchronizable Sec
-based access control withAccess Ref k
. If a password is intended to be shared between multiple applications, theSec Attr Access k
key must be specified, and each application using this password must have theSec Attr Access Group Keychain Access Groups Entitlement
enabled, and a common access group specified.Items stored or obtained using the
k
key may not also specify aSec Attr Synchronizable k
value that is incompatible with syncing (namely, those whose names end withSec Attr Accessible This
.)Device Only Items stored or obtained using the
k
key cannot be specified by reference. Use onlySec Attr Synchronizable k
and/orSec Return Attributes k
to retrieve results.Sec Return Data Do not use persistent references to synchronizable items. They cannot be moved between devices, and may not resolve if the item is modified on some other device.
When specifying a query that uses the
k
key, search keys are limited to the item's class and attributes. The only search constant that may be used isSec Attr Synchronizable k
; other constants using theSec Match Limit k
prefix are not supported.Sec Match