Ejemplo n.º 1
0
 public T GetAssertion <T>(string rootId) where T : class
 {
     if (Xassertion == null)
     {
         Xassertion = SerializerUtil.Serialize(GenerateAssertion()).Root;
     }
     return(SerializerUtil.Deserialize <T>(Xassertion, rootId));
 }
Ejemplo n.º 2
0
 public T GetAssertion <T>() where T : class
 {
     if (Xassertion == null)
     {
         Xassertion = SerializerUtil.Serialize(GenerateAssertion()).Root;
     }
     return(SerializerUtil.Deserialize <T>(Xassertion, typeof(Assertion).Name));
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 public T GetAssertion <T>(string rootid) where T : class
 {
     return(SerializerUtil.Deserialize <T>(Xassertion, rootid));
 }
Ejemplo n.º 5
0
 public T GetAssertion <T>() where T : class
 {
     return(SerializerUtil.Deserialize <T>(Xassertion));
 }
Ejemplo n.º 6
0
 public static SealCard Create <T>(T assertion)
 {
     return(new SealCard(SerializerUtil.Serialize(assertion).Root));
 }
Ejemplo n.º 7
0
 public static DgwsHeader Create <T>(T dgwsHeader)
 {
     return(new DgwsHeader(SerializerUtil.Serialize(dgwsHeader).Root));
 }
Ejemplo n.º 8
0
        public static FaultException ValidateSecurity <T>(T security) where T : class
        {
            var t = ValidateSecurity(SerializerUtil.Serialize(security).Root);

            return(MakeFault(t.Item1, t.Item1));
        }
Ejemplo n.º 9
0
 public static bool CheckAssertionSignatureNSCheck <T>(T element)
 {
     return(CheckAssertionSignatureNSCheck(SerializerUtil.Serialize(element).Root));
 }
Ejemplo n.º 10
0
        public static bool CheckAssertionSignature <T>(T element)
        {
            var ss = new SealSignedXml(SerializerUtil.Serialize(element));

            return(ss.CheckAssertionSignature());
        }