Ejemplo n.º 1
0
    def addClientAuth( self, socket: zmq.Socket ):
        self.logger.info( f"Adding ZMQ client auth using keys from dir: {self.cert_dir}")
        client_secret_file = os.path.join( self.secret_keys_dir, "client.key_secret")
        client_public, client_secret = zmq.auth.load_certificate(client_secret_file)
        socket.curve_secretkey = client_secret
        socket.curve_publickey = client_public

        server_public_file = os.path.join( self.public_keys_dir, "server.key")
        server_public, _ = zmq.auth.load_certificate(server_public_file)
        socket.curve_serverkey = server_public
Ejemplo n.º 2
0
def _load_auth(socket: zmq.Socket) -> None:
    import zmq
    import zmq.auth

    socket.curve_publickey, socket.curve_secretkey = zmq.curve_keypair()
    socket.curve_serverkey, _ = zmq.auth.load_certificate(".curve/server.key")