This method returns a Z85 encoded public and private key pair to be used in CURVE security setups.
ZeroMQ's new security constructs, specifically CURVE key management, is very explicit about what strings it will accept (keys MUST be a 32 byte long binary key or a 40 byte long Z85 encoded key with NULL terminiator). Whereas this code seems to have worked for a very long time, it was allocating byte buffers that weren't quite right for the CURVE settings and meant any attempt to use CURVE would simply fail with no visible reason (The server's private/public keys in the initial handshake didn't agree and the client was dropped). When I dropped down to the raw ffi-rzmq-core calls to set up CURVE authentication, communication proceeded perfectly. I realized that given a line like this: LibZMQ::zmq_setsockopt(socket, ::ZMQ::CURVE_SECRETKEY, SERVER_PRIVATE_KEY, SERVER_PRIVATE_KEY.length) where SERVER_PRIVATE_KEY is just a 40-character string, that we don't need to allocate any new data for passing string values into FFI. Once I made this change and re-ran my code with ffi-rzmq calls, everything worked perfectly. This change is unfortunately quite difficult to build an automated test around, so instead I'll add an example showing off the CURVE communication options, and as long as that's running then this feature still works.
Conflicts: History.txt ffi-rzmq.gemspec lib/ffi-rzmq/constants.rb lib/ffi-rzmq/context.rb lib/ffi-rzmq/libc.rb lib/ffi-rzmq/libzmq.rb lib/ffi-rzmq/message.rb lib/ffi-rzmq/socket.rb lib/ffi-rzmq/util.rb lib/ffi-rzmq/version.rb