Preparation (If running in Azure)
  1. Upload an x509 certificate into the Azure Management portal. Be sure to upload the pfx file which contains both the public and private key.
  2. Select properties on the certificate and click the middle tab
  3. Note the Thumbprint being used
  4. Save that Thumbprint into the code, as indicated by the Tasks, and into the .CSDEF file.

Preparation (If running in DevFabric)
  1. Use the Computer MMC Certificate-snap in to import a x509 certificat. Be sure to upload the pfx file which contains both the public and private key.
  2. Select properties on the certificate and click the middle tab
  3. Note the Thumbprint being used
  4. Save that Thumbprint into the code, as indicated by the Tasks, and into the .CSDEF file.


How to use:

To transparently encrypt a property simply apply the Encrypt attribute as shown below:

 public class Message   : Microsoft.WindowsAzure.StorageClient.TableServiceEntity
    {
        public Message()
        {
            PartitionKey = "a";
            RowKey = string.Format("{0:10}_{1}", DateTime.MaxValue.Ticks - DateTime.Now.Ticks, Guid.NewGuid());
        }

        public string Name { get; set; }
        
        [Encrypt]
        public string Body { get; set; }
     
        [DoNotSerialize]
        public string skipthis { get; set; }
     
        public string BodyCopy { get; set; }
    }



You may notice the DoNotSerialize attribute, just like the name indicates, it will cause an attribute to not be saved to Azure. It's included here because this project is an extension of previous work done by Phani Raju @MSFT http://blogs.msdn.com/b/phaniraj/archive/2008/12/11/customizing-serialization-of-entities-in-the-ado-net-data-services-client-library.aspx

This project is an extension of the Windows Azure "Working with Tables" sample from the Windows Azure Training Kit. The original, unmodified source is probably located here on your hard drive: C:\WAPTK\Labs\ExploringWindowsAzureStorageVS2010\Source\Ex01-WorkingWithTables\end\CS


Almost every check-in is informative and describes how you can build this project yourself, from scratch.
http://azuretableencrypt.codeplex.com/SourceControl/list/changesets

Last edited May 12, 2011 at 7:49 PM by clamont, version 2

Comments

No comments yet.