private void CreateLogin(string path, string username, string password) { username.ValidateUsername(); password.ValidatePassword(); var hashedPassword = SecureCrypto.Hash64(password, username); File.WriteAllText(path + "/" + username + ".lgn", hashedPassword); }
public void ChangeTokenUserPassword(string username, string newPassword) { newPassword.ValidatePassword(); var di = new DirectoryInfo(_mapServerService.Options.LoginManagerRootPath + "/token"); var fi = new FileInfo(di.FullName + "/" + username + ".lgn"); if (!fi.Exists) { throw new MapServerException("User '" + username + "' do not exists"); } var hashedPassword = SecureCrypto.Hash64(newPassword, username); File.WriteAllText(fi.FullName, hashedPassword); }