In my app, I use SecItem to store some data in the Keychain. I’d like to know — when a user sets up a new iPhone and transfers data from the old device, will those Keychain items be migrated or synced to the new device?
When using or …
That’s not right, or least it’s not the full story. For more on this topic, see the table in my post here.
Can I understand that my app has enabled Keychain sharing in "signing and capabilities" and my code does not set kSecAttrSynchronizable.
You are mixing up two things:
-
The Keychain Sharing capability is about sharing keychain items between apps on one device.
-
iCloud Keychain is about synching keychain items between the user’s various different devices.
If you don’t kSecAttrSynchronizable
then it defaults to false, meaning that the item won’t be synched to other devices. However, it can still end up moving to a different device by:
-
Encrypted backup and restore
-
Quick Start
If you don’t want that, set kSecAttrAccessible
to one of the ThisDeviceOnly
values.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"