public virtual void LoadXml(XmlElement value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            ReferenceType = value.LocalName;

            string uri = ElementUtils.GetAttribute(value, "URI", NS.XmlEncNamespaceUrl);

            if (uri == null)
            {
                throw new ArgumentNullException(SR.Cryptography_Xml_UriRequired);
            }
            Uri = uri;

            XmlNamespaceManager nsm = new XmlNamespaceManager(value.OwnerDocument.NameTable);

            nsm.AddNamespace("ds", XmlNameSpace.Url[NS.XmlDsigNamespaceUrl]);
            XmlNode transformsNode = value.SelectSingleNode("ds:Transforms", nsm);

            if (transformsNode != null)
            {
                TransformChain.LoadXml(transformsNode as XmlElement);
            }

            _cachedXml = value;
        }
        public override void LoadXml(XmlElement value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            ReferenceType = value.LocalName;
            string uri = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl);

            if (uri == null)
            {
                throw new System.Security.Cryptography.CryptographicException(SR.Cryptography_Xml_UriRequired);
            }
            Uri = uri;

            // Transforms
            XmlNamespaceManager nsm = new XmlNamespaceManager(value.OwnerDocument.NameTable);

            nsm.AddNamespace("enc", EncryptedXml.XmlEncNamespaceUrl);
            XmlNode transformsNode = value.SelectSingleNode("enc:Transforms", nsm);

            if (transformsNode != null)
            {
                TransformChain.LoadXml(transformsNode as XmlElement);
            }

            // cache the Xml
            _cachedXml = value;
        }
예제 #3
0
        public virtual void LoadXml(XmlElement value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            ReferenceType = value.LocalName;
            Uri           = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl);

            // Transforms
            XmlNamespaceManager nsm = new XmlNamespaceManager(value.OwnerDocument.NameTable);

            nsm.AddNamespace("ds", SignedXml.XmlDsigNamespaceUrl);
            XmlNode transformsNode = value.SelectSingleNode("ds:Transforms", nsm);

            if (transformsNode != null)
            {
                TransformChain.LoadXml(transformsNode as XmlElement);
            }

            // cache the Xml
            _cachedXml = value;
        }