예제 #1
0
        public void LoadXml(XmlElement value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(value.OwnerDocument.NameTable);

            nsmgr.AddNamespace("enc", "http://www.w3.org/2001/04/xmlenc#");
            XmlNode node  = value.SelectSingleNode("enc:CipherValue", nsmgr);
            XmlNode node2 = value.SelectSingleNode("enc:CipherReference", nsmgr);

            if (node != null)
            {
                if (node2 != null)
                {
                    throw new CryptographicException(SecurityResources.GetResourceString("Cryptography_Xml_CipherValueElementRequired"));
                }
                this.m_cipherValue = Convert.FromBase64String(System.Security.Cryptography.Xml.Utils.DiscardWhiteSpaces(node.InnerText));
            }
            else
            {
                if (node2 == null)
                {
                    throw new CryptographicException(SecurityResources.GetResourceString("Cryptography_Xml_CipherValueElementRequired"));
                }
                this.m_cipherReference = new System.Security.Cryptography.Xml.CipherReference();
                this.m_cipherReference.LoadXml((XmlElement)node2);
            }
            this.m_cachedXml = value;
        }
 public void LoadXml(XmlElement value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     XmlNamespaceManager nsmgr = new XmlNamespaceManager(value.OwnerDocument.NameTable);
     nsmgr.AddNamespace("enc", "http://www.w3.org/2001/04/xmlenc#");
     XmlNode node = value.SelectSingleNode("enc:CipherValue", nsmgr);
     XmlNode node2 = value.SelectSingleNode("enc:CipherReference", nsmgr);
     if (node != null)
     {
         if (node2 != null)
         {
             throw new CryptographicException(SecurityResources.GetResourceString("Cryptography_Xml_CipherValueElementRequired"));
         }
         this.m_cipherValue = Convert.FromBase64String(System.Security.Cryptography.Xml.Utils.DiscardWhiteSpaces(node.InnerText));
     }
     else
     {
         if (node2 == null)
         {
             throw new CryptographicException(SecurityResources.GetResourceString("Cryptography_Xml_CipherValueElementRequired"));
         }
         this.m_cipherReference = new System.Security.Cryptography.Xml.CipherReference();
         this.m_cipherReference.LoadXml((XmlElement) node2);
     }
     this.m_cachedXml = value;
 }
예제 #3
0
 public CipherData(System.Security.Cryptography.Xml.CipherReference cipherReference)
 {
     this.CipherReference = cipherReference;
 }