Ejemplo n.º 1
0
        public void getcommit(ucommit ucom, user u)
        {
            vtb.AppendText("Commitment request received from " + u.name + "! \n");

            if (ucom.getD() < ucom.getcert().getexp())
                if (verifyuser(ucom))
                    if (verifycert(ucom.getcert()))
                    {
                        vtb.AppendText("\tCommitment approved, message sent ! \n");
                        trust = true;
                        ucomm = ucom;
                        lastpay = new payment(ucom.getc0(),0);
                        u.comconfirm(true, this);
                        if (!(cycleth.IsAlive == true))
                            cycleth.Start();
                    }
                    else
                    {
                        vtb.AppendText("\tCertificate Signature Invalid, message sent ! \n");
                        u.comconfirm(false, this);
                    }
                else
                {
                    vtb.AppendText("\tUser Signature Invalid, message sent ! \n");
                    u.comconfirm(false, this);
                }
            else
            {
                vtb.AppendText("\tCertificate expired, message sent ! \n");
                u.comconfirm(false, this);
            }
        }
Ejemplo n.º 2
0
        public void getpayment(payment pay, user u)
        {
            int i = pay.geti();
            BigInteger temp = pay.getci();

            vtb.AppendText("Received payment of " + i + "$ from user: "******" !\n");
            for (int j = i; j > 0; j--)
                temp = hashf.hash(temp.ToString());
            if (temp == lastpay.getci())
            {
                i += lastpay.geti();
                lastpay = new payment(pay.getci(), i);
                vtb.AppendText("\tPayment approved, message sent !\n");
                u.payconfirm(true, this,0);
            }
            else
            {
                vtb.AppendText("\tPayment failed, message sent !\n");
                u.payconfirm(false, this,i);
            }
        }
Ejemplo n.º 3
0
 public redmess(payment pw, ucommit ucom)
 {
     lpay = pw;
     ucomm = ucom;
 }
Ejemplo n.º 4
0
        public void sendpayment(int pnr, vendor v)
        {
            currentpw += pnr;
            if (currentpw > pwnr)
                MessageBox.Show("Pay word limit for Today reached !");
            else
            {
                payment pay = new payment(pwords[currentpw], pnr);

                utb.AppendText("Sent payment of " + pnr + "$ to vendor: " + v.name + " !\n");
                v.getpayment(pay, this);
                changepw(pnr);
            }
        }
Ejemplo n.º 5
0
 public redmess(payment pw, ucommit ucom)
 {
     lpay  = pw;
     ucomm = ucom;
 }