Validate the SAMLResponse

Friends,
I need sample piece of c# .Net code which retrieve the SAMLResponse and authenticate with the provided certificate in our application.

Thanks,
Boobalan