Пример #1
0
        private void LoadXmlNodeListInput(XmlNodeList nodeList)
        {
            // Empty node list is not acceptable
            if (nodeList == null)
            {
                throw new ArgumentNullException(nameof(nodeList));
            }
            _containingDocument = Utils.GetOwnerDocument(nodeList);

            _nsm = new XmlNamespaceManager(_containingDocument.NameTable);
            _nsm.AddNamespace("dsig", SignedXml.XmlDsigNamespaceUrl);
            _inputNodeList = nodeList;
        }
        private void LoadXmlNodeListInput(XmlNodeList nodeList)
        {
            // Empty node list is not acceptable
            if (nodeList == null)
            {
                throw new ArgumentNullException(nameof(nodeList));
            }
            _containingDocument = Utils.GetOwnerDocument(nodeList);
            if (_containingDocument == null)
            {
                throw new CryptographicException(SR.Cryptography_Xml_EnvelopedSignatureRequiresContext);
            }

            _nsm = new XmlNamespaceManager(_containingDocument.NameTable);
            _nsm.AddNamespace("dsig", SignedXml.XmlDsigNamespaceUrl);
            _inputNodeList = nodeList;
        }
Пример #3
0
        internal CanonicalXml(XmlNodeList nodeList, bool includeComments)
        {
            if (nodeList == null)
            {
                throw new ArgumentNullException(nameof(nodeList));
            }

            XmlDocument doc = Utils.GetOwnerDocument(nodeList);

            if (doc == null)
            {
                throw new ArgumentException("nodeList");
            }

            _c14nDoc = new CanonicalXmlDocument(false, includeComments);
            _c14nDoc.LoadXml(doc.OuterXml);
            _ancMgr = new C14NAncestralNamespaceContextManager();

            MarkInclusionStateForNodes(nodeList, doc, _c14nDoc);
        }
Пример #4
0
        internal CanonicalXml(XmlNodeList nodeList, XmlResolver resolver, bool includeComments)
        {
            if (nodeList == null)
            {
                throw new ArgumentNullException("nodeList");
            }

            XmlDocument doc = Utils.GetOwnerDocument(nodeList);

            if (doc == null)
            {
                throw new ArgumentException("nodeList");
            }

            m_c14nDoc             = new CanonicalXmlDocument(false, includeComments);
            m_c14nDoc.XmlResolver = resolver;
            m_c14nDoc.Load(new XmlNodeReader(doc));
            m_ancMgr = new C14NAncestralNamespaceContextManager();

            MarkInclusionStateForNodes(nodeList, doc, m_c14nDoc);
        }
Пример #5
0
        internal ExcCanonicalXml(XmlNodeList nodeList, bool includeComments, string inclusiveNamespacesPrefixList, XmlResolver resolver)
        {
            if (nodeList == null)
            {
                throw new ArgumentNullException(nameof(nodeList));
            }

            XmlDocument doc = Utils.GetOwnerDocument(nodeList);

            if (doc == null)
            {
                throw new ArgumentException("nodeList");
            }

            _c14nDoc             = new CanonicalXmlDocument(false, includeComments);
            _c14nDoc.XmlResolver = resolver;
            _c14nDoc.Load(new XmlNodeReader(doc));
            _ancMgr = new ExcAncestralNamespaceContextManager(inclusiveNamespacesPrefixList);

            MarkInclusionStateForNodes(nodeList, doc, _c14nDoc);
        }