示例#1
0
        public async Task Decrypte()
        {
            if (txtPrivateKey.Text == "")
            {
                await ShowError("请输入私钥!");

                return;
            }
            byte[] value = await CheckDecrypte(txtResult.Text);

            if (value != null)
            {
                byte[] result    = null;
                string key       = txtPrivateKey.Text;
                bool   oaep      = cbbPadding.SelectedIndex == 1;
                int    keyLength = KeyLength;
                await Task.Run(() =>
                               result = RsaHelper.Decrypte(
                                   value,
                                   key,
                                   keyLength,
                                   oaep));

                txtSource.Text = await GetString(result, BinaryInputMode);
            }
        }