C# - Sign and validate json responses

Sometimes it's usefull to have some way to validate if a (server) response has been tampered with or not.

It can be used in addition to SSL which encryptes the message on its way from the server to the client and vice versa.

The script below is some kind of proof of concept and uses DSA as asymetric crypto provider and the ugly DataContractJsonSerializer. You can easily replace that with something smarter like JSON.NET.