[英]Decrypt a blob from Azure blob storage with key vault using version 12.x Azure storage libraries
我正在嘗試使用保管庫密鑰從 azure blob 存儲中下載和解密 blob,就像本教程一樣,除了鏈接的教程已過時。 I am using the latest Azure.Storage.Blobs
Nuget Package and do not see any way to do this as there is no BlobRequestOptions
or BlobEncryptionPolicy
object or similar in the package as is seen in the tutorial. 我查找的所有內容都指向我再次過時的鏈接教程。
這是我當前的代碼:
BlobServiceClient serviceClient = new BlobServiceClient("connectionString");
BlobContainerClient containerClient = serviceClient.GetBlobContainerClient("containerName");
BlobClient blobClient = containerClient.GetBlobClient("blobName");
await blobClient.DownloadToAsync(myStream);
在這里的某個地方,我想傳遞我的密鑰庫密鑰解析器來解密 blob,就像教程中一樣。
有沒有辦法做到這一點?
如果不是,那么當前使用密鑰庫解密 blob 的最佳方法是什么?
目前,在Azure.Storage.Blobs
中,您可以在BlobClientOptions
中使用EncryptionScope
。
在Azure.Storage.Blobs
中,您可以在BlobClientOptions
中使用EncryptionScope
。 您可以參考這篇文章來創建加密 scope。 但該功能處於預覽階段。
配置 azure 存儲容器后,您可以使用之前創建的指定加密 scope 上傳 Blob,並將BlobClientOptions
添加到BlobServiceClient
。
var options = new BlobClientOptions();
options.EncryptionScope= "joeyencrypt";
BlobServiceClient blobServiceClient = new BlobServiceClient("connectionString",options);
您可以使用
Azure.Storage.Blobs.Specialized.SpecializedBlobExtensions
public static BlobClient WithClientSideEncryptionOptions(this BlobClient client, ClientSideEncryptionOptions clientSideEncryptionOptions);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.