Exemplo n.º 1
0
 public void getredemption(redmess rm, vendor v)
 {
     btb.AppendText("Redemption received from vendor: "+v.name+" !\n");
     if(verifyuser(rm.getucomm()))
     {
         BigInteger start = rm.getucomm().getc0();
         BigInteger temp = rm.getlpay().getci();
         int l=rm.getlpay().geti();
         for(int i=l;i>0;i--)
             temp=hashf.hash(temp.ToString());
         if (start == temp)
         {
             btb.AppendText("\tRedemption verified ( for " + l.ToString() + "$ ), transaction initiated for vendor: " + v.name + " !\n");
             v.gettransinfo(l, this);
         }
         else
         {
             btb.AppendText("\tRedemption failed (invalid payment), sent message to vendor: " + v.name + " !\n");
             v.gettransinfo(0, this);
         }
     }
     else
     {
         btb.AppendText("\tRedemption failed (invalid user), sent message to vendor: " + v.name + " !\n");
         v.gettransinfo(0, this);
     }
 }
Exemplo n.º 2
0
 public void getredemption(redmess rm, vendor v)
 {
     btb.AppendText("Redemption received from vendor: " + v.name + " !\n");
     if (verifyuser(rm.getucomm()))
     {
         BigInteger start = rm.getucomm().getc0();
         BigInteger temp  = rm.getlpay().getci();
         int        l     = rm.getlpay().geti();
         for (int i = l; i > 0; i--)
         {
             temp = hashf.hash(temp.ToString());
         }
         if (start == temp)
         {
             btb.AppendText("\tRedemption verified ( for " + l.ToString() + "$ ), transaction initiated for vendor: " + v.name + " !\n");
             v.gettransinfo(l, this);
         }
         else
         {
             btb.AppendText("\tRedemption failed (invalid payment), sent message to vendor: " + v.name + " !\n");
             v.gettransinfo(0, this);
         }
     }
     else
     {
         btb.AppendText("\tRedemption failed (invalid user), sent message to vendor: " + v.name + " !\n");
         v.gettransinfo(0, this);
     }
 }
Exemplo n.º 3
0
 public void comconfirm(bool c,vendor v)
 {
     if (c == true)
         utb.AppendText("\tComitment to vendor: " + v.name + " confirmed !\n");
     else
     {
         ucomm = null;
         utb.AppendText("\tComitment to vendor: " + v.name + " failed !\n");
     }
     commited = c;
 }
Exemplo n.º 4
0
        public Payword()
        {
            InitializeComponent();
            dredeem = new d_redemption(redemption);

            Vendor = new vendor();
            Vendor.setUIfront(Vtextbox);
            Vendor.setfref(this);
            Broker = new broker();
            Broker.setUIfront(Btextbox);
        }
Exemplo n.º 5
0
 public void payconfirm(bool c, vendor v, int i)
 {
     if (c == true)
     {
         utb.AppendText("\tPayment to vendor: " + v.name + " confirmed !\n");
     }
     else
     {
         utb.AppendText("\tPayment to vendor: " + v.name + " failed !\n");
     }
     currentpw -= i;
 }
Exemplo n.º 6
0
 public void comconfirm(bool c, vendor v)
 {
     if (c == true)
     {
         utb.AppendText("\tComitment to vendor: " + v.name + " confirmed !\n");
     }
     else
     {
         ucomm = null;
         utb.AppendText("\tComitment to vendor: " + v.name + " failed !\n");
     }
     commited = c;
 }
Exemplo n.º 7
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);
            }
        }
Exemplo n.º 8
0
        public void sendcommit(vendor v)
        {
            genpaywords(pwnr + 1);
            currentpw = 0;
            utb.AppendText("Commitment : Generated 1$ paywords(" + pwnr + ") !\n");

            string     info   = "adinfo";
            string     sigstr = v.name + "," + cert.ToString() + "," + pwords[0].ToString() + "," + DateTime.Now.ToString() + "," + info;
            BigInteger sigh   = hashf.hash(sigstr);
            BigInteger sigU   = rsa.createSig(sigh, upvk);

            ucommit cmes = new ucommit(v.name, cert, pwords[0], DateTime.Now, info, sigU);

            ucomm = cmes;
            utb.AppendText("\tSent comitment to " + v.name + " !\n");
            v.getcommit(cmes, this);
        }
Exemplo n.º 9
0
 public void payconfirm(bool c, vendor v, int i)
 {
     if (c == true)
         utb.AppendText("\tPayment to vendor: " + v.name + " confirmed !\n");
     else
         utb.AppendText("\tPayment to vendor: " + v.name + " failed !\n");
     currentpw -= i;
 }
Exemplo n.º 10
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);
            }
        }
Exemplo n.º 11
0
        public void sendcommit(vendor v)
        {
            genpaywords(pwnr + 1);
            currentpw = 0;
            utb.AppendText("Commitment : Generated 1$ paywords(" + pwnr + ") !\n");

            string info = "adinfo";
            string sigstr = v.name + "," + cert.ToString() + "," + pwords[0].ToString() + "," + DateTime.Now.ToString() + "," + info;
            BigInteger sigh = hashf.hash(sigstr);
            BigInteger sigU = rsa.createSig(sigh, upvk);

            ucommit cmes = new ucommit(v.name, cert, pwords[0], DateTime.Now, info, sigU);
            ucomm = cmes;
            utb.AppendText("\tSent comitment to " + v.name + " !\n");
            v.getcommit(cmes, this);
        }
Exemplo n.º 12
0
 public void renewcommit(vendor v)
 {
     utb.AppendText("Renewing comitment !\n");
     sendcommit(v);
 }
Exemplo n.º 13
0
 public void renewcommit(vendor v)
 {
     utb.AppendText("Renewing comitment !\n");
     sendcommit(v);
 }