Jaydeep Suryawanshi Thank you for posting your question in Microsoft Q&A. Yes System.Security.Cryptography.Aes
is not supported in policy expressions and the list of supported CLR types are listed in .NET Framework types allowed in policy expressions.
We do have a sample policy snippet: Encrypt data using expressions.policy to encrypt text using AES algorithm and you can modify it for decrypt scenario like below (default mode is CBC):
<set-body>@{
byte[] IV = System.Text.Encoding.UTF8.GetBytes("5183666c72eec9e4");
byte[] Key = System.Text.Encoding.UTF8.GetBytes("bf3c199c2470cb477d907b1e0917c17b");
byte[] textinBytes = Encoding.UTF8.GetBytes("cipherText");
byte[] decryptedBytes = textinBytes.Decrypt("Aes", Key, IV);
string plaintext = Convert.ToBase64String(decryptedBytes);
return plaintext;
}</set-body>
For any feedback on supported policy expressions, feel free to submit via http://aka.ms/apimwish and our product team can review and prioritize it. I hope this helps with your question and let me know if you have any other questions.
If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.