Example #1
0
        public SettingDlg()
        {
            InitializeComponent();

            // init cmbCipherMode
            {
                cmbCipherMode.Items.Clear();

                foreach (string item in Consts.cipherModes)
                {
                    cmbCipherMode.Items.Add(item);
                }

                cmbCipherMode.SelectedIndex = 0;
            }

            // load
            {
                this.txtPortNo.Text = "" + Ground.i.portNo;
                this.cmbCipherMode.SelectedIndex = (int)Ground.i.cipherMode;
                _key = Ground.i.key;
                this.txtPassphrase.Text    = Ground.i.passphrase;
                this.txtForwardPortNo.Text = "" + Ground.i.forwardPortNo;
            }

            refreshUI();
        }
        public CrypTunnelProc(int recvPortNo, int forwardPortNo, Ground.KeyData key, string passphrase)
        {
            _recvPortNo    = recvPortNo;
            _forwardPortNo = forwardPortNo;
            _key           = key;
            _passphrase    = passphrase;

            startProc();
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="recvPortNo"></param>
        /// <param name="serverHost"></param>
        /// <param name="serverPortNo"></param>
        /// <param name="key">null == パスフレーズで暗号化する。</param>
        /// <param name="passphrase"></param>
        public CrypTunnelProc(int recvPortNo, string serverHost, int serverPortNo, Ground.KeyData key, string passphrase)
        {
            _recvPortNo   = recvPortNo;
            _serverHost   = serverHost;
            _serverPortNo = serverPortNo;
            _key          = key;
            _passphrase   = passphrase;

            startProc();
        }
Example #4
0
        private void setServerInfo(Ground.ServerInfo si)
        {
            this.txtTitle.Text  = si.title;
            this.txtHost.Text   = si.host;
            this.txtPortNo.Text = "" + si.portNo;
            this.cmbCipherMode.SelectedIndex = (int)si.cipherMode;
            _keyData = si.key;
            this.txtPassphrase.Text = si.passphrase;

            refreshUI();
        }
Example #5
0
        private void btnDefault_Click(object sender, EventArgs e)
        {
            // デフォルト値 -> UI
            {
                this.txtPortNo.Text = "" + 55900;
                this.cmbCipherMode.SelectedIndex = (int)Consts.CipherMode_e.NOT_ENCRYPT;
                _key = null;
                this.txtPassphrase.Text    = "";
                this.txtForwardPortNo.Text = "" + 55901;
            }

            refreshUI();
        }
Example #6
0
        private void btnKey_Click(object sender, EventArgs e)
        {
            using (KeyDataDlg f = new KeyDataDlg(_key))
            {
                f.ShowDialog();

                if (f.retKeyData != null)
                {
                    _key = f.retKeyData;
                    refreshUI();
                }
            }
        }
Example #7
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtIdent.Text == "")                 // ? 未入力
         {
             throw new FailedOperation("鍵が生成されていません。");
         }
         retKeyData = getKeyData();
         this.Close();
     }
     catch (Exception ex)
     {
         FailedOperation.caught(ex);
     }
 }
Example #8
0
        public KeyDataDlg(Ground.KeyData kd)
        {
            InitializeComponent();

            this.MinimumSize = this.Size;

            if (kd == null)
            {
                txtIdent.Text = "";
                txtRaw.Text   = "";
                txtHash.Text  = "";
            }
            else
            {
                txtIdent.Text = kd.ident;
                txtRaw.Text   = kd.raw;
                txtHash.Text  = kd.hash;
            }
        }
Example #9
0
 private void setKeyData(Ground.KeyData kd)
 {
     this.txtIdent.Text = kd.ident;
     this.txtRaw.Text   = kd.raw;
     this.txtHash.Text  = kd.hash;
 }