Esempio n. 1
0
        public static X509Certificate2 GetAssertionSignature(XElement element)
        {
            var ss = new SealSignedXml(element);

            if (ss.CheckAssertionSignature())
            {
                return(ss.GetSignature());
            }
            SetSamlDsPreFix(element);
            ss = new SealSignedXml(element);
            return(ss.GetSignature());
        }
Esempio n. 2
0
        public static bool CheckAssertionSignatureNSCheck(XElement element)
        {
            var ss = new SealSignedXml(element);

            if (ss.CheckAssertionSignature())
            {
                return(true);
            }
            SetSamlDsPreFix(element);
            ss = new SealSignedXml(element);
            return(ss.CheckAssertionSignature());
        }
Esempio n. 3
0
        internal static void CheckAndSetSamlDsPreFix(XDocument xdoc)
        {
            var signature = xdoc.Descendants(NameSpaces.xsaml + "Assertion").Elements(NameSpaces.xds + "Signature").FirstOrDefault();

            if (signature != null)
            {
                var ss = new SealSignedXml(xdoc);
                if (!ss.CheckAssertionSignature())
                {
                    SetSamlDsPreFix(xdoc.Root);
                    var ss2 = new SealSignedXml(xdoc.Root);
                    if (!ss2.CheckAssertionSignature())
                    {
                        throw new FaultException("Error in signature of assertion in requestheader");
                    }
                }
            }
        }
Esempio n. 4
0
        public static bool CheckAssertionSignature(XElement element)
        {
            var ss = new SealSignedXml(element);

            return(ss.CheckAssertionSignature());
        }
Esempio n. 5
0
        public static bool CheckAssertionSignature <T>(T element)
        {
            var ss = new SealSignedXml(SerializerUtil.Serialize(element));

            return(ss.CheckAssertionSignature());
        }