How to sync keychain over iCloud
Asked Answered
R

1

18

I wan't to store sensitive data for my app in the keychain. I'd also like this to sync over devices, using iCloud.

According to Apple this is possible:

Does iCloud Keychain work with third-party apps?

Yes. Developers can update their apps to work with iCloud Keychain. Passwords saved by those apps are kept up to date on all devices that use the app and are using iOS 7.0.3 or later or OS X Mavericks v10.9 or later.

However, I can't find any documentation about what is needed by the app. Will all content of the keychain be synced if the user has enabled iCloud Keychain?

Riel answered 18/11, 2015 at 8:59 Comment(2)
Thanks for the down vote. What's the problem with the question?Riel
Seriously, If there's something wrong with the question I'll be happy to rephrase it. Just let me know what the problem is :]Riel
I
16

You need to set the kSecAttrSynchronizable attribute when adding any item that you want to be synced. I would suggest using a wrapper library such as KeychainAccess (in swift) or UICKeyChainStore (in Obj-C), as it largely facilitates the handling of the keychain and of the various attributes (they both provide a synchronizable property)

Ingrid answered 8/12, 2015 at 16:5 Comment(1)
Does it forces the re-sync with iCloud even if the user has the Keychain iCloud disabled? imore.com/how-use-icloud-keychain-iphone-and-ipadCopybook

© 2022 - 2024 — McMap. All rights reserved.