Beispiel #1
0
        internal static CT_Encryption Parse(XmlNode node, XmlNamespaceManager nameSpaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Encryption encryption = new CT_Encryption();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "keyData")
                {
                    encryption.keyData = CT_KeyData.Parse(childNode, nameSpaceManager);
                }
                else if (childNode.LocalName == "dataIntegrity")
                {
                    encryption.dataIntegrity = CT_DataIntegrity.Parse(childNode, nameSpaceManager);
                }
                else if (childNode.LocalName == "keyEncryptors")
                {
                    encryption.keyEncryptorsField = CT_KeyEncryptors.Parse(childNode, nameSpaceManager);
                }
            }
            return(encryption);
        }
Beispiel #2
0
        internal static CT_DataIntegrity Parse(XmlNode node, XmlNamespaceManager nameSpaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_DataIntegrity ctObj = new CT_DataIntegrity();

            if (node.Attributes["encryptedHmacKey"] != null)
            {
                ctObj.encryptedHmacKey = Convert.FromBase64String(node.Attributes["encryptedHmacKey"].Value);
            }
            if (node.Attributes["encryptedHmacValue"] != null)
            {
                ctObj.encryptedHmacValue = Convert.FromBase64String(node.Attributes["encryptedHmacValue"].Value);
            }
            return(ctObj);
        }