예제 #1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            btnGenerate.Enabled = false;
            RSAKeySizeListItem selectedItem = cmbKeySize.SelectedItem as RSAKeySizeListItem;

            RSA_AsymetricEncryption.RSAKeySize keySize = (RSA_AsymetricEncryption.RSAKeySize)Enum.Parse(typeof(RSA_AsymetricEncryption.RSAKeySize), selectedItem.Value.ToString());

            ClearKeys();

            var t = new Task(() => this.GenerateRSAKeyPair(keySize));

            t.Start();
            t.GetAwaiter().OnCompleted(UpdateFormControlsWhenOperationComplete);
        }
예제 #2
0
 private void GenerateRSAKeyPair(RSA_AsymetricEncryption.RSAKeySize keySize)
 {
     isRunning         = true;
     rsaKeySetIdentity = _rsaAsymetricEncryption.GenerateRSAKeyPair(keySize);
     isRunning         = false;
 }