internal void SetPassword(string password, ILoadTestConfig config)
        {
            var saltBytes = config.Encoding.GetBytes(config.Security.PasswordSalt);

            using (var aes = Aes.Create())
            {
                using (var cipher = aes.CreateEncryptor(config.Security.PasswordSaltKey, config.Security.PasswordSaltIV))
                {
                    Salt = cipher.TransformFinalBlock(saltBytes, 0, saltBytes.Length);
                }
            }

            var saltedPassword      = config.Security.PasswordSalt + password;
            var saltedPasswordBytes = config.Encoding.GetBytes(saltedPassword);

            using (var sha = SHA256.Create())
            {
                Password = sha.ComputeHash(saltedPasswordBytes);
            }
        }
Beispiel #2
0
        public IdentityAsyncDAOWrapper(ILoadTestConfig config)
        {
            switch (config.DBMS)
            {
            case LoadTestDBMS.Pgsql:
                _dao = new IdentityPgsqlDAO(config.PgsqlConnection);
                break;

            case LoadTestDBMS.Mysql:
                _dao = new IdentityMysqlDAO(config.MysqlConnection);
                break;

            case LoadTestDBMS.Mongodb:
                _dao = new IdentityMongodbDAO(config.MongoConnection);
                break;

            default:
                throw new NotImplementedException(config.DBMS.ToString() + "not implemented");
            }
        }
        internal DataMigration(ILoadTestConfig config)
        {
            _disposeDAO = true;

            switch (config.DBMS)
            {
            case LoadTestDBMS.Pgsql:
                _dataMigrationDAO = new DataMigrationPgsqlDAO(config.PgsqlConnection);
                break;

            case LoadTestDBMS.Mysql:
                _dataMigrationDAO = new DataMigrationMysqlDAO(config.MysqlConnection);
                break;

            case LoadTestDBMS.Mongodb:
                _dataMigrationDAO = new DataMigrationMongodbDAO(config.MongoConnection);
                break;

            default:
                throw new NotImplementedException("DBMS not implemented");
            }
        }
 public IdentityController(ILoadTestConfig configuration, IIdentityDAO identityDAO, IIdentityAsyncDAO identityAsyncDAO)
 {
     _config           = configuration;
     _identityDAO      = identityDAO;
     _identityAsyncDAO = identityAsyncDAO;
 }