NAME

ZMQ::Raw::Curve - ZeroMQ CURVE methods

VERSION

version 0.24

DESCRIPTION

ZeroMQ CURVE methods.

SYNOPSIS

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');

METHODS

keypair( )

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.

public( $private )

Derive the public key from a private key.

AUTHOR

Jacques Germishuys <jacquesg@striata.com>

LICENSE AND COPYRIGHT

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.