Esempio n. 1
0
        private Task <CryptographyClient> GetClient(string key) =>
        _identityService.GetAccessTokenForApplicationAsync()
        .ContinueWith(async t =>
        {
            var keyClient = new KeyClient(new Uri(Configuration.VaultUri),
                                          ExistingTokenCredential.FromAccessToken(t.Result));
            var keyObject = await keyClient.GetKeyAsync(key);

            return(new CryptographyClient(
                       keyObject.Value.Id,
                       ExistingTokenCredential.FromAccessToken(t.Result)));
        }).Unwrap();
Esempio n. 2
0
 private Task <CryptographyClient> GetClient() =>
 _identityService.GetAccessTokenForApplicationAsync()
 .ContinueWith(t => new CryptographyClient(
                   new Uri(Configuration.KeyIdUri),
                   ExistingTokenCredential.FromAccessToken(t.Result)));