server_public_key, public_key, private_key ) else: options = {} self.pub, self.sub = self.create_notification_client( pub_address, sub_address, options=options ) self.sub.observable.subscribe(lambda x: self.log.info(f"received: {x}")) if __name__ == "__main__": with tempfile.TemporaryDirectory() as trusted_keys_path, tempfile.TemporaryDirectory() as untrusted_keys_path: # create key pairs in corresponding directories Agent.create_curve_certificates(trusted_keys_path, "server") Agent.create_curve_certificates(trusted_keys_path, "listener") Agent.create_curve_certificates(untrusted_keys_path, "listener2") # load key pairs server_public_key, server_private_key = Agent.load_curve_certificate( os.path.join(trusted_keys_path, "server.key_secret") ) listener_public_key, listener_private_key = Agent.load_curve_certificate( os.path.join(trusted_keys_path, "listener.key_secret") ) listener2_public_key, listener2_private_key = Agent.load_curve_certificate( os.path.join(untrusted_keys_path, "listener2.key_secret") ) broker = NotificationBroker(