0
votes

When a certain parameter(bool encrypt=true) is set then the file will be uploading to azure storage account with key-vault encryption, user have the flexibility to change that parameter value and file can be uploaded without any encryption(bool encrypt=false).

there is a possibility of having encrypted and unencrypted file in the same storage account in 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.

1

1 Answers

1
votes

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

Yes, we could encrypted or unencrypted a blob as we need.

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

If the blob is encrypted by keyvault, there is an encryptiondata metadata in the blob. You could refer to this tutorial get more info about how to 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