コード例 #1
0
        public Task <string> GetAsync(string key)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(nameof(key));
            }

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

            return(Task.FromResult(value));
        }
コード例 #2
0
        // The always default choose the most secure user is comfy with
        public Task SetAsync(string key, string value)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(nameof(key));
            }

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

            KeyChain kc = new KeyChain(DefaultAccessible);

            kc.SetValueForKey(value, key);

            return(Task.CompletedTask);
        }
コード例 #3
0
        public bool Remove(string key)
        {
            var kc = new KeyChain(DefaultAccessible);

            return(kc.Remove(key));
        }