zmq_curve_public.txt 1.4 KB

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