Exemple #1
0
        public frmMain(BitChatProfile profile, string profileFilePath, string cmdLine)
        {
            InitializeComponent();

            _profile         = profile;
            _profileFilePath = profileFilePath;

            SecureChannelCryptoOptionFlags cryptoOptions;

            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.Win32NT:
                if (Environment.OSVersion.Version.Major > 5)
                {
                    cryptoOptions = SecureChannelCryptoOptionFlags.ECDHE256_RSA_WITH_AES256_CBC_HMAC_SHA256 | SecureChannelCryptoOptionFlags.DHE2048_RSA_WITH_AES256_CBC_HMAC_SHA256;
                }
                else
                {
                    cryptoOptions = SecureChannelCryptoOptionFlags.DHE2048_RSA_WITH_AES256_CBC_HMAC_SHA256;
                }
                break;

            default:
                cryptoOptions = SecureChannelCryptoOptionFlags.DHE2048_RSA_WITH_AES256_CBC_HMAC_SHA256;
                break;
            }

            //start bitchat service
            _service = new BitChatService(profile, Program.TRUSTED_CERTIFICATES, cryptoOptions, InvalidCertificateEvent);
        }
Exemple #2
0
        private void InvalidCertificateEvent(BitChatService sender, InvalidCertificateException e)
        {
            MessageBox.Show(e.Message + "/r/n/r/nClick OK to logout from this Bit Chat profile.", "Invalid Certificate Detected", MessageBoxButtons.OK, MessageBoxIcon.Error);

            this.Hide();
            this.DialogResult = System.Windows.Forms.DialogResult.Ignore;
            this.Close();
        }
Exemple #3
0
        private void InvalidCertificateEvent(BitChatService sender, InvalidCertificateException e)
        {
            MessageBox.Show(e.Message, "Invalid Certificate Detected", MessageBoxButtons.OK, MessageBoxIcon.Error);

            notifyIcon1.Visible = false;
            this.Hide();
            this.DialogResult = System.Windows.Forms.DialogResult.Ignore;
            this.Close();
        }
Exemple #4
0
        public frmSettings(BitChatService service)
        {
            InitializeComponent();

            _service = service;

            BitChatProfile profile = service.Profile;

            txtPort.Text           = profile.LocalEP.Port.ToString();
            txtDownloadFolder.Text = profile.DownloadFolder;
            chkUseCRL.Checked      = profile.CheckCertificateRevocationList;

            foreach (Uri tracker in profile.TrackerURIs)
            {
                txtTrackers.Text += tracker.AbsoluteUri + "\r\n";
            }

            _timer          = new Timer();
            _timer.Interval = 1000;
            _timer.Tick    += _timer_Tick;
            _timer.Start();
        }