Exemplo n.º 1
0
        private void OnOpenAppButtonClick(object sender, EventArgs e)
        {
            using ( EnterAppNameForm dlg = new EnterAppNameForm() ) {
            DialogResult res = dlg.ShowDialog(this);
            if ( res == DialogResult.OK ) {
               string key, iv;
               SsoConfiguration config = new SsoConfiguration();
               config.LoadApplicationData(dlg.ApplicationName, out key, out iv);
               SetCurrentApplication(dlg.ApplicationName);

               if ( !String.IsNullOrEmpty(key) )
                  _key.Key = Convert.FromBase64String(key);
               else
                  _key.KeyString = "";
               if ( !String.IsNullOrEmpty(iv) )
                  _key.IV = Convert.FromBase64String(iv);
               else
                  _key.IVString = "";
            }
             }
        }
Exemplo n.º 2
0
        private void OnNewAppButtonClick(object sender, EventArgs e)
        {
            using ( EnterAppNameForm dlg = new EnterAppNameForm() ) {
            DialogResult res = dlg.ShowDialog(this);
            if ( res == DialogResult.OK ) {
               SsoConfiguration config = new SsoConfiguration();
               config.CreateApplication(dlg.ApplicationName);
               SetCurrentApplication(dlg.ApplicationName);

               keyTextBox.Text = "";
               ivTextBox.Text = "";

               statusLabel.Text = "Application created successfully";
            }
             }
        }