public void Constructor_XmlDocument() { XmlDecryption encryptedXml = new XmlDecryption(null); Assert.Equal(DefaultEncoding, encryptedXml.GetEncoding()); Assert.Equal(DefaultCipherMode, encryptedXml.GetMode()); Assert.Equal(DefaultPaddingMode, encryptedXml.GetPadding()); Assert.Equal(DefaultRecipient, encryptedXml.Recipient); Assert.Equal(DefaultXmlResolver, encryptedXml.GetResolver()); Assert.Equal(DefaultXmlDSigSearchDepth, encryptedXml.GetXmlDSigSearchDepth()); }
private void ReplaceEncryptedData(XmlElement encryptedDataElement, byte[] decrypted) { XmlNode parent = encryptedDataElement.ParentNode; if (parent.NodeType == XmlNodeType.Document) { parent.InnerXml = XmlDecryption.GetEncoding().GetString(decrypted); } else { XmlDecryption.ReplaceData(encryptedDataElement, decrypted); } }