public void SaveSymmetricKey(SymmetricKey sKey)
 {
     var op = TableOperation.InsertOrReplace(sKey);
     var cloudTable = GetTable();
     var result = cloudTable.Execute(op);
 }
        /// <summary>
        /// Creates a symmetric key.  See this link for more information behind the numbers
        /// http://blogs.msdn.com/b/shawnfa/archive/2006/10/09/the-differences-between-rijndael-and-aes.aspx
        /// </summary>
        /// <returns></returns>
        private SymmetricKey CreateNewAESSymmetricKeyset()
        {
            if (cert == null)
            {
                throw new InvalidOperationException("Unable to create new AES keyset; Certificate not loaded.");
            }

            byte[] symmKey, iv;

            using (AesManaged aes = new AesManaged())
            {
                aes.GenerateIV();
                aes.GenerateKey();

                symmKey = aes.Key;
                iv = aes.IV;

                aes.Clear();
            }

            // Encrypt the Symmetric Key for storage
            byte[] encryptedKey = EncryptRSA(symmKey, cert);

            SymmetricKey symmKeySet = new SymmetricKey() {
                iv = iv,
                Key = encryptedKey,
                CertificateThumbprint = cert.Thumbprint
            };

            return symmKeySet;
        }
 public void DeleteSymmetricKey(SymmetricKey sKey)
 {
     var op = TableOperation.Delete(sKey);
     GetTable().Execute(op);
 }