protected override string DoReadContent(string path, IDecryptionAlgorithm decryptionAlgorithm)
        {
            var encryptedContent   = ReadContent(path);
            var decryptedAlgorithm = decryptionAlgorithm.Decrypt(encryptedContent);

            return(decryptedAlgorithm);
        }
        protected override JsonDocument DoReadContent(string path, IDecryptionAlgorithm decryptionAlgorithm)
        {
            var text = _fileSystem.File.ReadAllText(path);

            var decryptedContent = decryptionAlgorithm.Decrypt(text);

            try
            {
                var document = JsonDocument.Parse(decryptedContent);
                return(document);
            }
            catch (JsonException)
            {
                return(null);
            }
        }
Beispiel #3
0
        protected override XDocument DoReadContent(string path, IDecryptionAlgorithm decryptionAlgorithm)
        {
            var encryptedContent = _fileSystem.File.ReadAllText(path);
            var decryptedContent = decryptionAlgorithm.Decrypt(encryptedContent);

            try
            {
                using (var decryptionContentStream = decryptedContent.ToStream())
                {
                    var xDoc = XDocument.Load(decryptionContentStream);
                    return(xDoc);
                }
            }
            catch (System.Xml.XmlException)
            {
                return(null);
            }
        }