示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            /* 1. Set Service name from the combobox
             * 2. Create Encrypted timestamp and append it in the ticket
             * 3. Give the ticket to Client Class
             * 4. Give the encrypted timestamp to Client class
             *
             * */
            f.printProcess("\n\nCreate Message and Encryption using Key TGS(Scenario 6)", ncolor);
            p.setServiceName(comboBox1.Text);
            string ticket  = "ID:" + idBox.Text + ":createdtime:" + (DateTime.Now.ToString("yyyyMMddHHmm")) + ":expritytime:" + (DateTime.Now.AddMinutes(5).ToString("yyyyMMddHHmm")) + ":service:" + comboBox1.SelectedItem;
            string message = ticket + ":timestamp:" + p.getTimeStamp();

            p.setMessage(message);
            messageTextBox.Text = p.getMessage();
            string encMessage = secCol.encryption(secCol.getBit(p.getMessage()), tabCol, p.getTGSKey(), f); //encrypt time stamp

            messageBox.Text = encMessage;
            p.setTicket(ticket);
            p.setServiceName(comboBox1.Text);
            p.setEncMessage(encMessage);
            button4.Enabled = true;
            button2.Enabled = false;
            mainPage.setFlag(6);
        }