4
votes

I have a bunch of apps using the same keychain group for sharing some sensitive data. It works fine when testing the apps in same device, they can access and edit the shared data. I wonder if it is possible to share data between iDevices, my iPad (iOS 7) and iPhone (iOS 6) seems to store them separately (is it local?), I thought it was stored securely in Apple's servers since it is called iCloud Keychain.

I use the KeychainWrapper class from RayWenderlich tutorial with a slight modification for having a unique keychain access group.

+ (NSMutableDictionary *)setupSearchDirectoryForIdentifier:(NSString *)identifier {
    ...
    //Added this line 
    [searchDictionary setObject:KEYCHAINGROUP forKey:(__bridge id)kSecAttrAccessGroup];
    ...
    return searchDictionary;
}

Is it possible to share data between devices and apps simultaneously using Keychain? If so how should I implement it?

2

2 Answers

2
votes

Now you can just add kSecAttrSynchronizable attribute to keychain's item for synchronizing through icloud between devices: https://developer.apple.com/documentation/security/ksecattrsynchronizable

Also rather use a special library such as KeychainAccess for managing keychain (check this answer)

-1
votes

Keychain stores data at the local device. If you need to share sensitive data among devices, you can encrypt the data and store it on iCloud.