예제 #1
0
 // ------------------------------------------------------------------------------------------
 private void TestForm_Shown(object sender, EventArgs e)
 {
     textBoxConsole.AppendText("Klucz publiczny RSA" + Environment.NewLine);
     textBoxConsole.AppendText(ersa.GetPublicKey() + Environment.NewLine);
     textBoxConsole.AppendText(Environment.NewLine);
     textBoxConsole.AppendText("Klucz publiczny ElGamal" + Environment.NewLine);
     textBoxConsole.AppendText(elgamal.GetPublicKey() + Environment.NewLine);
     textBoxConsole.AppendText(Environment.NewLine);
 }
예제 #2
0
        // ------------------------------------------------------------------------------------------
        /// <summary> Funkcja wysyłająca do serwera dane konfiguracyjne klienta. </summary>
        private void ConfigureServerCommand()
        {
            string publicKey = "";

            //  Konfiguracja publicznego klucza szyfrującego wiadomości dla serwera.
            if (cryptType != CryptType.None)
            {
                publicKey = encryptionServices.GetPublicKey();
            }

            string content = Tools.ConcatLines(
                new string[] { Username, ((int)this.cryptType).ToString(), publicKey, "<end>" },
                0, 4, Environment.NewLine);

            Message newMessage = new Message(identifier, 0, DateTime.Now, "/config", content);

            SendMessage(newMessage);
        }