ZMQ::Raw::Curve - ZeroMQ CURVE methods
version 0.22
ZeroMQ CURVE methods.
use ZMQ::Raw; # client my ($private, $public) = ZMQ::Raw::Curve->keypair(); my $req = ZMQ::Raw::Socket->new ($ctx, ZMQ::Raw->ZMQ_REQ); $req->setsockopt (ZMQ::Raw::Socket->ZMQ_CURVE_SECRETKEY, $private); $req->setsockopt (ZMQ::Raw::Socket->ZMQ_CURVE_PUBLICKEY, $public); $req->setsockopt (ZMQ::Raw::Socket->ZMQ_CURVE_SERVERKEY, $server_public); # server my $private = ZMQ::Raw::Curve->keypair(); my $rep = ZMQ::Raw::Socket->new ($ctx, ZMQ::Raw->ZMQ_REP); $rep->setsockopt (ZMQ::Raw::Socket->ZMQ_CURVE_SECRETKEY, $private); $rep->setsockopt (ZMQ::Raw::Socket->ZMQ_CURVE_SERVER, 1); $rep->bind ('tcp://*:5555');
Create a new, generated random keypair consisting of a private and public key. Returns the private and public key in list context and only the private key in scalar context.
Derive the public key from a private key.
Jacques Germishuys <jacquesg@striata.com>
Copyright 2017 Jacques Germishuys.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install ZMQ::Raw, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ZMQ::Raw
CPAN shell
perl -MCPAN -e shell install ZMQ::Raw
For more information on module installation, please visit the detailed CPAN module installation guide.