コード例 #1
0
        public async Task <string> WrapKey(string key, byte[] unwrappedKey)
        {
            var wrappedKey = await KeyVaultClientExtensions.WrapKeyAsync(kvc, key, ALGORITHM, unwrappedKey);

            return(wrappedKey.Kid);
        }
 private byte[] AzureKeyVaultWrap(
     string masterKeyPath,
     string encryptionAlgorithm,
     byte[] columnEncryptionKey)
 {
     if (columnEncryptionKey == null)
     {
         throw new ArgumentNullException(nameof(columnEncryptionKey));
     }
     return(Task.Run <KeyOperationResult>((Func <Task <KeyOperationResult> >)(() => KeyVaultClientExtensions.WrapKeyAsync((IKeyVaultClient)this.KeyVaultClient, masterKeyPath, encryptionAlgorithm, columnEncryptionKey, new CancellationToken()))).Result.Result);
 }