private void regbtgenerrsa_Click(object sender, EventArgs e) { ClientRSA clientrsa = new ClientRSA(); regtbpublic.Text = clientrsa.Publickey; regtbprivate.Text = clientrsa.Privatekey; }
private void regbtreg_Click(object sender, EventArgs e) { ClientRSA clientrsa = new ClientRSA(); SafePart.src.Message message = new SafePart.src.Message(); string filename = Filename.MasterPublicKey; string temp = "1"; temp += '\n'; temp += message.Messagevalue; temp += '\n'; try { if (Common.sendfileandstring(filename, temp)) { MessageBox.Show("注册已发送, 等待审核."); } else { MessageBox.Show("注册已发送, 等待审核."); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public UniversalClient() { Client = new TcpClient(); Encryption = new ClientRSA(); clientSignature = new Signature(); clientSignature.clientId = FingerPrint.Value(); clientSignature.clientIp = new WebClient().DownloadString("http://icanhazip.com"); }
static void Main() { ClientRSA client = new ClientRSA(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new main()); }
private void initregtab() { SafePart.src.Message message = new SafePart.src.Message(); if (string.IsNullOrEmpty(message.Number)) { regstatusvalue.Text = "没有注册的"; } else { regstatusvalue.Text = "已注册"; ClientRSA clientrsa = new ClientRSA(); regtbpublic.Text = clientrsa.Publickey; regtbprivate.Text = clientrsa.Privatekey; } }
public int DecryptInt(ByteArray itemToDecrypt) { return(BitConverter.ToInt32(ClientRSA.Decrypt(itemToDecrypt.Bytes, false), 0)); }
public string DecryptString(ByteArray strTodecrypt) { return(BitConverter.ToString(ClientRSA.Decrypt(strTodecrypt.Bytes, false))); }
public double DecryptDouble(ByteArray itemToDecrypt) { return(BitConverter.ToDouble(ClientRSA.Decrypt(itemToDecrypt.Bytes, false), 0)); }
public float DecryptFloat(ByteArray itemToDecrypt) { return(BitConverter.ToSingle(ClientRSA.Decrypt(itemToDecrypt.Bytes, false), 0)); }
public bool DecryptBool(ByteArray itemToDecrypt) { return(BitConverter.ToBoolean(ClientRSA.Decrypt(itemToDecrypt.Bytes, false), 0)); }
public long DecryptLong(ByteArray itemToDecrypt) { return(BitConverter.ToInt64(ClientRSA.Decrypt(itemToDecrypt.Bytes, false), 0)); }
public void Dispose() { Client = null; Encryption = null; clientSignature = null; }