Esempio n. 1
0
        static Task <string> PlatformGetAsync(string key)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(nameof(key));
            }

            var kc    = new KeyChain(DefaultAccessible);
            var value = kc.ValueForKey(key, Alias);

            return(Task.FromResult(value));
        }
Esempio n. 2
0
        public static Task SetAsync(string key, string value, SecAccessible accessible)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(nameof(key));
            }

            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            var kc = new KeyChain(accessible);

            kc.SetValueForKey(value, key, Alias);

            return(Task.CompletedTask);
        }
Esempio n. 3
0
        static void PlatformRemoveAll()
        {
            var kc = new KeyChain(DefaultAccessible);

            kc.RemoveAll(Alias);
        }
Esempio n. 4
0
        static bool PlatformRemove(string key)
        {
            var kc = new KeyChain(DefaultAccessible);

            return(kc.Remove(key, Alias));
        }
        static Task <string> PlatformGetAsync(string key)
        {
            var kc = new KeyChain();

            return(Task.FromResult(kc.ValueForKey(key, Alias)));
        }