azure - 如何检查 Azure 存储文件是否已 Key-Vault 加密

标签 azure azure-blob-storage azure-keyvault

当设置某个参数(bool encrypt=true)时,文件将上传到带有 key 保管库加密的Azure存储帐户,用户可以灵活地更改该参数值,并且文件可以上传时不进行任何加密(bool encrypt=false)。

Azure 中的同一存储帐户中可能存在加密和未加密的文件。

So, while downloading a file how can i get to know that the file is encrypted and i don't need to decrypt it.

最佳答案

there is a possibility of having encrypted and unencrypted file in the same storage account in Azure.

是的,我们可以根据需要加密或解密 blob。

So, while downloading a file how can i get to know that the file is encrypted and i don't need to decrypt it.

如果 blob 通过 keyvault 加密,则 blob 中会有一个加密数据元数据。您可以引用本教程获取有关如何Encrypt and decrypt blobs in Microsoft Azure Storage using Azure Key Vault的更多信息

 blob.FetchAttributes();

 if (blob.Metadata.ContainsKey("encryptiondata"))
 {   
     var encryptiondataVaule = blob.Metadata["encryptiondata"]; 
     // check to encryptiondataVaule then add your logic here
 }
 else
 {
    // the blob is not encrypted by azure keyvault
 }

enter image description here

关于azure - 如何检查 Azure 存储文件是否已 Key-Vault 加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47674717/

相关文章:

Azure 应用服务即使已停止也会使用服务总线队列消息

c# - 使用 C# 库还原 azure blob 快照

python - 如何检查以确保 blob_service.put_block_blob_from_path() 在 python 中成功?

azure - 当我在管道上运行部署命令时,它失败并提示 MSI 未正确配置

azure - 使用客户端 key 检索 Azure KeyVault key

azure - 将服务主体客户端 ID 和 key 传递给 ARM 模板

Azure Cloud Shell - 无法识别术语 'Stop-AzureVM'

python - Azure Blob 存储 - 可以列出 blob,但不能删除 blob

json - ADF : Split a JSON file with an Array of Objects into Single JSON files containing One Element in Each

c# - 在 C# 中以编程方式将 secret 添加到 Key Vault