Exemplo n.º 1
0
	def __init__( self, listen, wait_time, public_name, privkey,
	              logger=logging.getLogger("myopic_notary") ):
		"""listen is the (host, port) tuple we should listen on; wait_time is the
		amount of time (in seconds) that we make a client wait before giving them a
		token; public_name is the	domain or IP at which clients can access us;
		privkey is a serialized Blinder instance."""

		self.wait_time = wait_time
		self.public_name = public_name

		self._server = socket.socket()
		self._server.bind(listen)
		self._server.listen(8)

		self._logger = logger

		self.privkey = Blinder.deserialize(privkey)

		self.clients = set()
Exemplo n.º 2
0
	def __init__(self, notary_addr, notary_key, wait_time):
		self.notary_addr = notary_addr
		self.notary_key = Blinder.deserialize( base64.b64decode(notary_key) )
		self.wait_time = wait_time