I'm using the certificate that comes with the product. Not sure what I'm doing wrong. I tried using SHA256 as well.
X509Certificate2 x509Certificate = new X509Certificate2(@"D:\Projects\Sandbox\ComponentSpace SAML\ComponentSpace SAML v2.0 for .NET\Examples\SSO\HighLevelAPI\WebForms\ExampleServiceProvider\Certificates\sp.pfx", "password");
LogoutRequest logoutRequest = new LogoutRequest();
logoutRequest.NameID = new NameID("kmilleson");
logoutRequest.Destination = "
https://localhost/ExampleIdentityProvider/SAML/SLOService.aspx"; logoutRequest.Issuer = new Issuer("
https://localhost/ExampleServiceProvider"); logoutRequest.IssueInstant = DateTime.UtcNow;
logoutRequest.NotOnOrAfter = DateTime.UtcNow.AddMinutes(1);
logoutRequest.Reason = "SP Logout";
logoutRequest.SessionIndexes = new List<SessionIndex>();
SessionIndex session = new SessionIndex("_" + Guid.NewGuid());
logoutRequest.SessionIndexes.Add(session);
SAMLMessageSignature.Generate(logoutRequest.ToXml(), x509Certificate.PrivateKey, x509Certificate, null, SAMLIdentifiers.DigestMethods.SHA1, SAMLIdentifiers.SignatureMethods.RSA_SHA1);
// this works but is unsigned
SingleLogoutService.SendLogoutRequestByHTTPPost(Response, "
https://localhost/ExampleIdentityProvider/SAML/SLOService.aspx", (XmlElement)logoutRequest.ToXml(), null);