Global Variable

kSecAttrSynchronizable

A key whose value is a string indicating whether the item is synchronized through iCloud.

Declaration

let kSecAttrSynchronizable: CFString

Discussion

The corresponding value is of type CFString 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 kCFBooleanTrue. If the key is not supplied, or has a value of kCFBooleanFalse, then no synchronizable items are added or returned. Use kSecAttrSynchronizableAny 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.

The following caveats apply when you specify the kSecAttrSynchronizable key:

  • Updating or deleting items using the kSecAttrSynchronizable 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.

  • Only password items can be synchronized. Keychain syncing is not supported for certificates or cryptographic keys.

  • Items stored or obtained using the kSecAttrSynchronizable key cannot specify SecAccess based access control with kSecAttrAccess. If a password is intended to be shared between multiple applications, the kSecAttrAccessGroup key must be specified, and each application using this password must have a keychain-access-groups entitlement with the specified access group value.

  • Items stored or obtained using the kSecAttrSynchronizable key may not also specify a kSecAttrAccessible value that is incompatible with syncing (namely, those whose names end with ThisDeviceOnly.)

  • Items stored or obtained using the kSecAttrSynchronizable key cannot be specified by reference. Use only kSecReturnAttributes and/or kSecReturnData to retrieve results.

  • 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 kSecAttrSynchronizable key, search keys are limited to the item's class and attributes. The only search constant that may be used is kSecMatchLimit; other constants using the kSecMatch prefix are not supported.

See Also

General Item Attribute Keys

let kSecAttrAccess: CFString

A key whose value in an access instance indicating access control list settings for this item.

let kSecAttrAccessControl: CFString

A key whose value in an access control instance indicating access control settings for the item.

let kSecAttrAccessible: CFString

A key whose value indicates when a keychain item is accessible.

let kSecAttrAccessGroup: CFString

A key whose value is a string indicating the access group an item is in.

let kSecAttrCreationDate: CFString

A key whose value indicates the item's creation date.

let kSecAttrModificationDate: CFString

A key whose value indicates the item's last modification date.

let kSecAttrDescription: CFString

A key whose value is a string indicating the item's description.

let kSecAttrComment: CFString

A key whose value is a string indicating a comment associated with the item.

let kSecAttrCreator: CFString

A key whose value indicates the item's creator.

let kSecAttrType: CFString

A key whose value indicates the item's type.

let kSecAttrLabel: CFString

A key whose value is a string indicating the item's label.

let kSecAttrIsInvisible: CFString

A key whose value is a Boolean indicating the item's visibility.

let kSecAttrIsNegative: CFString

A key whose value is a Boolean indicating whether the item has a valid password.

let kSecAttrSyncViewHint: CFString

A key whose value is a string that provides a sync view hint.