Пример #1
0
        public async Task <string> GetValueAsync(string context, string key)
        {
            var ctx = DeserializeContext(context);

            key        = key ?? throw new SecureStoreException();
            _dsvClient = await _clientFactory.GetClient(ctx);

            var response = await _dsvClient.GetSecretAsync(key);

            return(response?.Data["password"].ToString());
        }
Пример #2
0
        public async Task <Credential> GetCredentialsAsync(string context, string key)
        {
            var ctx = DeserializeContext(context);

            key        = key ?? throw new SecureStoreException();
            _dsvClient = await _clientFactory.GetClient(ctx);

            var response = await _dsvClient.GetSecretAsync(key);

            return(new Credential()
            {
                Username = response.Data["username"].ToString(),
                Password = response.Data["password"].ToString(),
            });
        }