示例#1
0
        public async Task <byte[]> DecryptAsync(byte[] ciphertextBlob, IDictionary <string, string> context = null)
        {
            var request = new DecryptRequest(keyId, ciphertextBlob, context != null ? new JsonObject(context) : null);

            var result = await client.DecryptAsync(request).ConfigureAwait(false);

            return(result.Plaintext);
        }
示例#2
0
        public async Task <byte[]> DecryptAsync(
            byte[] ciphertext,
            IEnumerable <KeyValuePair <string, string> >?aad = null)
        {
            var request = new DecryptRequest(keyId, ciphertext, GetEncryptionContext(aad));

            var result = await client.DecryptAsync(request).ConfigureAwait(false);

            return(result.Plaintext);
        }
示例#3
0
 public Task <DecryptResponse> DecryptAsync(DecryptRequest request)
 {
     return(SendAsync <DecryptResponse>("Decrypt", request));
 }
示例#4
0
 public Task <DecryptResponse> DecryptAsync(DecryptRequest request) =>
 SendAsync <DecryptResponse>("Decrypt", request);