public void getcertificate(bcertificate c) { utb.AppendText("\tCertificate received from: " + c.getbroker() + " !\n"); cert = c; //set nr or paywords from certificate string[] ax = cert.getinfo().Split(':'); pwnr = Convert.ToInt32(ax[1]); }
private bool verifycert(bcertificate cert) { rsakey bpbkey = cert.getbroker().bpbk; string mess = cert.getbroker().ToString() + "," + cert.getuser() + "," + cert.getaddress() + "," + cert.getukey().ToString() + "," + cert.getexp().ToString() + "," + cert.getinfo(); BigInteger messh = hashf.hash(mess); return(rsa.verifySig(messh, cert.getsigB(), bpbkey)); }
public void getrequest(urequest ureq, user u) { btb.AppendText("Received request from user: "******" !\n"); DateTime exp = DateTime.Now; exp = exp.AddMonths(1); exp = exp.AddDays(1); //string info = "Certificate generated for user: "******" on " + DateTime.Now; string info = "Nr. of paywords:1100"; string sigstr = this.ToString() + "," + ureq.getname() + "," + ureq.getmail() + "," + ureq.getkey().ToString() + "," + exp.ToString() + "," + info; BigInteger sigh = hashf.hash(sigstr); BigInteger sigB = rsa.createSig(sigh, bpvk); bcertificate cert = new bcertificate(this, ureq.getname(), ureq.getmail(), ureq.getkey(), exp, info, sigB); clist.Add(cert); sendcertificate(cert, u); }
public void sendcertificate(bcertificate c, user u) { btb.AppendText("\tRequest aproved. Sent certificate to user: "******" !\n"); u.getcertificate(c); }