public override void Load(Stream stream)
        {
            var source = Source as EJsonConfigurationSource;
            var logger = source?.LoggerFactory?.CreateLogger(this.GetType());
            var path   = source?.Path;

            try
            {
                var privateKeyProvider = GetKeyProvider(source);
                var decryptedJson      = _eJsonCrypto.GetDecryptedJson(stream, privateKeyProvider);

                using (var memoryStream = new MemoryStream())
                    using (var streamWriter = new StreamWriter(memoryStream))
                    {
                        streamWriter.Write(decryptedJson);
                        streamWriter.Flush();
                        memoryStream.Position = 0;

                        base.Load(memoryStream);
                    }

                logger?.LogInformation(default(EventId), "EJSON loaded from {path}", path);
            }
            catch (Exception exception)
            {
                logger?.LogError(default(EventId), exception, "Could not load EJSON from {path}", path);
            }
        }
        internal static string GetDecryptedJsonFromFile(this IEJsonCrypto eJsonCrypto, string fileName, IPrivateKeyProvider keyProvider, IFileSystem fileSystem)
        {
            fileSystem = fileSystem ?? new FileSystemWrapper();
            var json = fileSystem.ReadAllText(fileName);

            return(eJsonCrypto.GetDecryptedJson(json, keyProvider));
        }
        public static string GetDecryptedJson(this IEJsonCrypto eJsonCrypto, Stream stream, IPrivateKeyProvider keyProvider = null)
        {
            var json = new StreamReader(stream).ReadToEnd();

            return(eJsonCrypto.GetDecryptedJson(json, keyProvider));
        }