1ZMQ_CURVE_PUBLIC(3) 0MQ Manual ZMQ_CURVE_PUBLIC(3)
2
3
4
6 zmq_curve_public - derive the public key from a private key
7
9 int zmq_curve_public (char *z85_public_key, char *z85_secret_key);
10
12 The zmq_curve_public() function shall derive the public key from a
13 private key. The caller provides two buffers, each at least 41 octets
14 large. In z85_secret_key the caller shall provide the private key, and
15 the function will store the public key in z85_public_key. The keys are
16 encoded using zmq_z85_encode(3).
17
19 The zmq_curve_public() function shall return 0 if successful, else it
20 shall return -1 and set errno to one of the values defined below.
21
23 ENOTSUP
24 The libzmq library was not built with cryptographic support
25 (libsodium).
26
28 Deriving the public key from a CURVE private key.
29
30 char public_key [41];
31 char secret_key [41];
32 int rc = zmq_curve_keypair (public_key, secret_key);
33 assert (rc == 0);
34 char derived_public[41];
35 rc = zmq_curve_public (derived_public, secret_key);
36 assert (rc == 0);
37 assert (!strcmp (derived_public, public_key));
38
39
41 zmq_z85_decode(3) zmq_z85_encode(3) zmq_curve_keypair(3) zmq_curve(7)
42
44 This page was written by the 0MQ community. To make a change please
45 read the 0MQ Contribution Policy at
46 http://www.zeromq.org/docs:contributing.
47
48
49
500MQ 4.3.4 01/21/2023 ZMQ_CURVE_PUBLIC(3)