/// <summary> /// Migrates all the given keys to be synchronized with users iCloud account. /// </summary> /// <returns><c>true</c>, if all keys migrated to cloud storage successfully, <c>false</c> otherwise.</returns> /// <param name="keys">Keys that already exist in keychain</param> public static bool MigrateAllToCloudStorage(params string[] keys) { if (null == keys) { throw new ArgumentNullException(nameof(keys)); } var cloud = new SecureStorageImplementation { UseCloud = true }; var local = new SecureStorageImplementation { UseCloud = false }; var allGood = true; foreach (var key in keys) { if (!Migrate(local, cloud, key)) { allGood = false; } } return(allGood); }
/// <summary> /// Migrates the given key to cloud storage. /// </summary> /// <returns><c>true</c>, if key was successfully changed to be synchronized <c>false</c> otherwise.</returns> /// <param name="key">Key.</param> public static bool MigrateToCloudStorage(string key) { if (null == key) { throw new ArgumentNullException(nameof(key)); } var cloud = new SecureStorageImplementation { UseCloud = true }; var local = new SecureStorageImplementation { UseCloud = false }; return(Migrate(local, cloud, key)); }