public T GetAssertion <T>(string rootId) where T : class { if (Xassertion == null) { Xassertion = SerializerUtil.Serialize(GenerateAssertion()).Root; } return(SerializerUtil.Deserialize <T>(Xassertion, rootId)); }
public T GetAssertion <T>() where T : class { if (Xassertion == null) { Xassertion = SerializerUtil.Serialize(GenerateAssertion()).Root; } return(SerializerUtil.Deserialize <T>(Xassertion, typeof(Assertion).Name)); }
public static T SignAssertion <T>(T element, X509Certificate2 cert) where T : class { var sxml = new SealSignedXml(SerializerUtil.Serialize(element)); var xassertion = sxml.xml.GetElementsByTagName("Assertion", NameSpaces.saml)[0] as XmlElement; if (xassertion == null) { throw new InvalidOperationException("Assertion not found"); } var keyName = xassertion.GetElementsByTagName("KeyName", NameSpaces.ds)[0].InnerText; var xsignature = sxml.GetDGWSSign(cert); xsignature.SetAttribute("id", keyName); xassertion.AppendChild(xsignature); return(SerializerUtil.Deserialize <T>(sxml.xml.DocumentElement)); }
public T GetAssertion <T>(string rootid) where T : class { return(SerializerUtil.Deserialize <T>(Xassertion, rootid)); }
public T GetAssertion <T>() where T : class { return(SerializerUtil.Deserialize <T>(Xassertion)); }
public static SealCard Create <T>(T assertion) { return(new SealCard(SerializerUtil.Serialize(assertion).Root)); }
public static DgwsHeader Create <T>(T dgwsHeader) { return(new DgwsHeader(SerializerUtil.Serialize(dgwsHeader).Root)); }
public static FaultException ValidateSecurity <T>(T security) where T : class { var t = ValidateSecurity(SerializerUtil.Serialize(security).Root); return(MakeFault(t.Item1, t.Item1)); }
public static bool CheckAssertionSignatureNSCheck <T>(T element) { return(CheckAssertionSignatureNSCheck(SerializerUtil.Serialize(element).Root)); }
public static bool CheckAssertionSignature <T>(T element) { var ss = new SealSignedXml(SerializerUtil.Serialize(element)); return(ss.CheckAssertionSignature()); }