Example #1
0
        private void BuildSecurityProfiles(IServiceProvider serviceProvider, IEncryptionProfileDictionaryBuilder builder)
        {
            var applicationSettings = serviceProvider.GetRequiredService <ApplicationSettings>();

            builder.Add(EncryptionClassification.Personal, profile =>
            {
                profile.Encoding               = Encoding.ASCII;
                profile.InitialVector          = Convert.FromBase64String(applicationSettings.InitialVector);
                profile.Key                    = Convert.FromBase64String(applicationSettings.PersonalKey);
                profile.Salt                   = Convert.FromBase64String(applicationSettings.Salt);
                profile.HashAlgorithmType      = HashAlgorithmType.Sha512;
                profile.SymmetricAlgorithmName = nameof(Aes);

                return(profile);
            }).Add(EncryptionClassification.Common, profile => {
                profile.Encoding               = Encoding.ASCII;
                profile.InitialVector          = Convert.FromBase64String(applicationSettings.InitialVector);
                profile.Key                    = Convert.FromBase64String(applicationSettings.CommonKey);
                profile.Salt                   = Convert.FromBase64String(applicationSettings.Salt);
                profile.HashAlgorithmType      = HashAlgorithmType.Sha512;
                profile.SymmetricAlgorithmName = nameof(Aes);

                return(profile);
            }).Add(EncryptionClassification.Shared, profile => {
                profile.Encoding               = Encoding.ASCII;
                profile.InitialVector          = Convert.FromBase64String(applicationSettings.InitialVector);
                profile.Key                    = Convert.FromBase64String(applicationSettings.SharedKey);
                profile.Salt                   = Convert.FromBase64String(applicationSettings.Salt);
                profile.HashAlgorithmType      = HashAlgorithmType.Sha512;
                profile.SymmetricAlgorithmName = nameof(Aes);

                return(profile);
            });
        }
Example #2
0
 private void BuildSecurityProfiles(IServiceProvider arg1, IEncryptionProfileDictionaryBuilder arg2)
 {
 }