gnutls_pubkey_export_dh_raw(3)

πŸ’– gnutls_pubkey_export_dh_raw(3) πŸ’–

okay bestie, so this one lives in the gnutls manual, and it's literally called gnutls_pubkey_export_dh_raw β€” it's an API function, no cap. let's get into it 🫢


✨ NAME ✨

gnutls_pubkey_export_dh_raw β€” API function 🌸


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/abstract.h>

int gnutls_pubkey_export_dh_raw(gnutls_pubkey_t key, gnutls_dh_params_t
params, gnutls_datum_t * y, unsigned flags);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_pubkey_t key β€” this one holds the public key, like it's the main character holding the whole plot together πŸ’…
  • gnutls_dh_params_t params β€” this will hold the Diffie-Hellman parameter. it's optional, but heads up: it must be initialized. so like, don't hand it over all unready, bestie, it needs its moment to be prepared first ✨
  • gnutls_datum_t * y β€” this one will hold the y. that's it, that's the whole job πŸ“
  • unsigned flags β€” flags from gnutls_abstract_export_flags_t, so go pick your faves from there 🌈

πŸ’« DESCRIPTION πŸ’«

so what this function does is it exports the Diffie-Hellman public key parameter that it found living inside the given public key. and the new parameter? it gets allocated using gnutls_malloc(), and then it's stored in the appropriate datum. very demure, very mindful, very allocated πŸ’–

now, if you're trying to retrieve the other parameters β€” the ones that are common in both the public key and the private key β€” then you actually want gnutls_dh_params_export_raw() instead. different function, different vibe, don't mix them up 🧚

and this lil detail is important: this function allows for NULL parameters since 3.4.1. iconic behavior honestly πŸ‘‘


⭐ RETURNS ⭐

you get GNUTLS_E_SUCCESS on success πŸŽ‰ β€” otherwise, a negative error code. so if it's negative, that's your sign something went sideways, and it's giving "not today" 😭


🌸 SINCE 🌸

3.8.2 πŸ’œ


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't be shy, report it to <bugs@gnutls.org>.

home page: https://www.gnutls.org


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. so like, go forth, but keep the receipts 🫢


🌈 SEE ALSO 🌈

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, then bestie, visit:

https://www.gnutls.org/manual/


and that's the whole page, fr fr β€” this was the gnutls manual, version 3.8.13, for gnutls_pubkey_export_dh_raw(3). slay, go export those Diffie-Hellman params πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from