I have a JSON string that I need to return it as an encrypted stream in web api in HttpResponseMessage. The client then receives the encrypted stream and decrypts it like this.
private string str(HttpWebResponse AStream)
{
string result;
using (Stream responseStream = AStream.GetResponseStream())
{
result = DecryptAesStream(responseStream, Key);
return result;
}
}
Do I need to encrypt the JSON string first, load it to a filestream but then how do I return it in HttpRepsonseMessage since it takes string as a content? Any hints what I need to do?
You can try something like this