Пример #1
0
 def setUp(self):
     self.server = ServerProxy("http://localhost:8000", allow_none=True)
     self.consultant_id = 0
     self.consultant_privkey = "".join(open('./keys/consultant.pem').readlines())
     self.consultant_pubkey = "".join(open('./keys/consultant.pub.pem').readlines())
     self.client_privkey = "".join(open('./keys/client1.pem').readlines())
     self.client_pubkey = "".join(open('./keys/client1.pub.pem').readlines())
     self.client_id = 1
     self.tree_id = util.digest(self.client_id)
Пример #2
0
 def setUp(self):
     self.server = ServerProxy("http://localhost:8000", allow_none=True)
     self.consultant_id = 0
     self.consultant_privkey = "".join(open('./keys/consultant.pem').readlines())
     self.consultant_pubkey = "".join(open('./keys/consultant.pub.pem').readlines())
     self.client_privkey = "".join(open('./keys/client1.pem').readlines())
     self.client_pubkey = "".join(open('./keys/client1.pub.pem').readlines())
     self.client_id = 1
     self.tree_id = util.digest(self.client_id)
     # add a pubkey to the serv
     sig = util.sign(self.consultant_privkey, False, "add_pubkey")
     #call the server
     self.server.add_pubkey(b64encode(sig), self.client_id, b64encode(self.tree_id), self.client_pubkey)