Exemple #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));
 }
Exemple #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));
 }
Exemple #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));
        }
Exemple #4
0
 public T GetAssertion <T>(string rootid) where T : class
 {
     return(SerializerUtil.Deserialize <T>(Xassertion, rootid));
 }
Exemple #5
0
 public T GetAssertion <T>() where T : class
 {
     return(SerializerUtil.Deserialize <T>(Xassertion));
 }
Exemple #6
0
 public static SealCard Create <T>(T assertion)
 {
     return(new SealCard(SerializerUtil.Serialize(assertion).Root));
 }
Exemple #7
0
 public static DgwsHeader Create <T>(T dgwsHeader)
 {
     return(new DgwsHeader(SerializerUtil.Serialize(dgwsHeader).Root));
 }
Exemple #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));
        }
Exemple #9
0
 public static bool CheckAssertionSignatureNSCheck <T>(T element)
 {
     return(CheckAssertionSignatureNSCheck(SerializerUtil.Serialize(element).Root));
 }
Exemple #10
0
        public static bool CheckAssertionSignature <T>(T element)
        {
            var ss = new SealSignedXml(SerializerUtil.Serialize(element));

            return(ss.CheckAssertionSignature());
        }