首页 > 解决方案 > 如何解密 Azure 存储中的加密二进制文件?

问题描述

我正在尝试使用 PowerShell 解密加密的 blob 文件?找不到任何方法来做到这一点?如果有人有解决方案,请告诉我。

标签: azurepowershell

解决方案


如果您真的想这样做,您可能需要使用 C# 代码并使用 Powershell 脚本执行代码。

跟着documentation

// In this case, we will not pass a key and only pass the resolver because
// this policy will only be used for downloading / decrypting.
BlobEncryptionPolicy policy = new BlobEncryptionPolicy(null, cloudResolver);
BlobRequestOptions options = new BlobRequestOptions() { EncryptionPolicy = policy };

using (var np = File.Open(@"C:\data\MyFileDecrypted.txt", FileMode.Create))
    blob.DownloadToStream(np, null, options, null);

推荐阅读