1ZMQ_Z85_ENCODE(3) 0MQ Manual ZMQ_Z85_ENCODE(3)
2
3
4
6 zmq_z85_encode - encode a binary key as Z85 printable text
7
9 char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size);
10
12 The zmq_z85_encode() function shall encode the binary block specified
13 by data and size into a string in dest. The size of the binary block
14 must be divisible by 4. The dest must have sufficient space for size *
15 1.25 plus 1 for a null terminator. A 32-byte CURVE key is encoded as 40
16 ASCII characters plus a null terminator.
17
18 The encoding shall follow the ZMQ RFC 32 specification.
19
21 The zmq_z85_encode() function shall return dest if successful, else it
22 shall return NULL.
23
25 Encoding a CURVE key.
26
27 #include <sodium.h>
28 uint8_t public_key [32];
29 uint8_t secret_key [32];
30 int rc = crypto_box_keypair (public_key, secret_key);
31 assert (rc == 0);
32 char encoded [41];
33 zmq_z85_encode (encoded, public_key, 32);
34 puts (encoded);
35
36
38 zmq_z85_decode(3) zmq_curve_keypair(3) zmq_curve_public(3) zmq_curve(7)
39
41 This page was written by the 0MQ community. To make a change please
42 read the 0MQ Contribution Policy at
43 http://www.zeromq.org/docs:contributing.
44
45
46
470MQ 4.3.4 07/22/2023 ZMQ_Z85_ENCODE(3)