ZMQ_CURVE_KEYPAIR(3)
π ZMQ_CURVE_KEYPAIR β ok so we're making a CURVE keypair π
bestie. hi. you're in the 0MQ Manual section and this is the page for zmq_curve_keypair, and it's literally the glow-up your app's crypto needs. let's go β¨
πΈ SYNOPSIS πΈ
int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);
that's it. two args. one vibe. π
π¦ DESCRIPTION π¦
okay so the way that zmq_curve_keypair() works is it hands you a freshly generated random keypair β one public key, one secret key, matched set, no notes, main character energy π₯.
here's the thing though: you bring the buffers. the caller (that's you, bestie π«Ά) provides two buffers, and each one has to be at least 41 octets large. that's not a suggestion, that's a vibe check you don't wanna fail. the function drops the keys in there for you.
and the keys come out encoded with zmq_z85_encode(3) β so what's sitting in your buffers is Z85, not raw bytes. cute, portable, iconic β.
β¨ RETURN VALUE β¨
0β slay, it worked π-1β not slay π, anderrnogets set to one of the values down below
π ERRORS π
ENOTSUPβ the libzmq library was not built with cryptographic support (libsodium). like, the crypto girlies never got invited to this build party. no keypair for you, sorry bestie π
π EXAMPLE π
generating a new CURVE keypair, obviously π
char public_key [41];
char secret_key [41];
int rc = zmq_curve_keypair (public_key, secret_key);
assert (rc == 0);
see how the buffers are exactly 41? 41 octets minimum, bestie, we said what we said. π
π SEE ALSO π
π AUTHORS π
this page was written by the 0MQ community π and if you wanna make a change (yes you, you're so capable), please read the 0MQ Contribution Policy at http://www.zeromq.org/docs:contributing. the way that contributing is literally free therapy πΈ
okay final sign-off bestie: this page is from 0MQ 4.3.5, dated 10/09/2023, filed under ZMQ_CURVE_KEYPAIR(3). go forth and generate keypairs, you're doing amazing sweetie π
β¨π¦
π¦ where this page comes from
- epel 10: zeromq 4.3.5-18.el10_0 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 43: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 43: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 44: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 44: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms