Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Added curve-authentication #445
I took czmq as base and tried to adapt curve-authentication to jzmq. I made some test-cases, so that might be the best start trying to follow what I did. Feel free to comment. Cheers....
Here some howtos:
You can specify the directory,where your certificates (in ZMP-Format) are located,like this:
Create a certificate and save it to disk like this:
ZCert client_cert = new ZCert(); client_cert.setMeta("name", "Client test certificate"); client_cert.savePublic(".curve/testcert.pub"); //client_cert.saveSecret(".curve/testcert.secret");
// Create and bind server socket ZMQ.Socket server = ctx.createSocket(ZMQ.PUSH); server.setZAPDomain("global".getBytes()); server.setCurveServer(true); server.setCurvePublicKey(server_cert.getPublicKey()); server.setCurveSecretKey(server_cert.getSecretKey()); server.bind("tcp://*:9000");
Create a client:
// Create and connect client socket ZMQ.Socket client = ctx.createSocket(ZMQ.PULL); client.setCurvePublicKey(client_cert.getPublicKey()); client.setCurveSecretKey(client_cert.getSecretKey()); client.setCurveServerKey(server_cert.getPublicKey()); client.connect("tcp://127.0.0.1:9000");
Did you see the travis-tests for open-jdk6 didn't finish? At least not in this pullrequest. But ran through after your merge!? The test seemed to block, so I will add some timeouts to be sure. Additionally I just saw, that on curve-authentication the certificate-folder is scanned twice. Will fix this and create another pull-request.