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; }
public CipherData(System.Security.Cryptography.Xml.CipherReference cipherReference) { this.CipherReference = cipherReference; }