Search code examples
iossecuritypersistencekeychain

What happens to Keychain when iPhone is restored from backup?


If you take a backup of iOS Device A and restore Device B from the backup of Device A, will you also get the data from Keychain in Device A restored? or not?


Solution

  • It depends on how the keychain items have been stored on Device A. Each app can decide if it's items will be restored to any device, or to the original device only. See Key Chain Concepts:

    The second dimension of item accessibility determines whether the item migrates to a new device when a backup is restored. If the item’s kSecAttrAccessible attributes ends with the string ThisDeviceOnly, the item is restored to the same device that created a backup, but it is not migrated to a new device when restoring another device’s backup data.