コード例 #1
0
        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());
        }
コード例 #2
0
        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);
            }
        }