/// <summary>
        /// Decrypts the authnResponse, then modifies the artifactresponse too.
        /// </summary>
        /// <param name="serviceProvider">ServiceProvider instance, so we can extract
        /// information about the SP configuration.</param>
        public void Decrypt(ServiceProvider serviceProvider)
        {
            authnResponse.Decrypt(serviceProvider);
            XmlNode node = xml.SelectSingleNode("//samlp:Response", nsMgr).ParentNode;

            node.InnerXml = ((XmlNode)authnResponse.XmlDom).InnerXml;
        }
 /// <summary>
 /// Validates the given AuthnResponse object.
 /// </summary>
 /// <param name="authnResponse">AuthnResponse object.</param>
 /// <param name="authnRequests">
 /// Collection of previously sent authnRequests used to compare with
 /// the InResponseTo attribute (if present) of the AuthnResponse.
 /// </param>
 /// <see cref="ServiceProviderUtility.Validate(AuthnResponse, ICollection)"/>
 public void ValidateForPost(AuthnResponse authnResponse, ICollection authnRequests)
 {
     if (authnResponse.XmlResponseSignature == null && authnResponse.isAssertionEncrypted())
     {
         authnResponse.Decrypt(ServiceProvider);
     }
     this.CheckSignature(authnResponse);
     if (authnResponse.isAssertionEncrypted())
     {
         authnResponse.Decrypt(ServiceProvider);
     }
     this.Validate(authnResponse, authnRequests);
 }