Esempio n. 1
0
        internal XmlElement GetXml(XmlDocument document)
        {
            if (ReferenceType == null)
            {
                throw new CryptographicException(SR.Cryptography_Xml_ReferenceTypeRequired);
            }

            // Create the Reference
            XmlElement referenceElement = document.CreateElement(ReferenceType, EncryptedXml.XmlEncNamespaceUrl);

            if (!string.IsNullOrEmpty(_uri))
            {
                referenceElement.SetAttribute("URI", _uri);
            }

            // Add the transforms to the CipherReference
            if (TransformChain.Count > 0)
            {
                referenceElement.AppendChild(TransformChain.GetXml(document, SignedXml.XmlDsigNamespaceUrl));
            }

            return(referenceElement);
        }