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

How To Check Azure Storage File Is Key-Vault Encrypted Or Not

当设置了某个参数(bool encrypt=true)时,文件将上传到带有key-vault加密的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 中有一个 encryptiondata 元数据。您可以参考本教程以获取有关如何 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
 }