Secure storage implementation for iOS. It is primarily for storing secure strings such as generic password.
Inheritance: Plugin.SecureStorage.Abstractions.SecureStorageImplementationBase
コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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));
        }