Пример #1
0
        private static string GetEncryptedConfiguration <TSettings>(IServiceScope scope, string settingsParamName)
            where TSettings : class, new()
        {
            var config                 = scope.ServiceProvider.GetRequiredService <IConfiguration>();
            var settings               = config.GetSettings <TSettings>(settingsParamName);
            var encryptationKey        = scope.ServiceProvider.GetRequiredService <EncryptionKey>().Key;
            var encryptedConfiguration = EncrypterManager.Encrypt(settings, encryptationKey);

            return(encryptedConfiguration);
        }