Exemple #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);
            if (_containingDocument == null)
            {
                throw new System.Security.Cryptography.CryptographicException(SR.Cryptography_Xml_EnvelopedSignatureRequiresContext);
            }

            _nsm = new XmlNamespaceManager(_containingDocument.NameTable);
            _nsm.AddNamespace("dsig", SignedXml.XmlDsigNamespaceUrl);
            _inputNodeList = nodeList;
        }
        internal CanonicalXml(XmlNodeList nodeList, XmlResolver resolver, bool includeComments)
        {
            if (nodeList == null)
            {
                throw new ArgumentNullException(nameof(nodeList));
            }

            XmlDocument doc = Utils.GetOwnerDocument(nodeList);

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

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

            MarkInclusionStateForNodes(nodeList, doc, _c14nDoc);
        }