gnutls_dh_get_pubkey(3)

πŸ’– gnutls_dh_get_pubkey β€” like, the manual page, bestie ✨

okay so we're in the gnutls manual (yes that gnutls, the 3.8.13 era one) and today's main character is gnutls_dh_get_pubkey, an API function. buckle up, it's giving cryptography but make it cute πŸŽ€


🌸 NAME 🌸

gnutls_dh_get_pubkey β€” API function. that's the whole name section, she's concise πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

int gnutls_dh_get_pubkey(gnutls_session_t session, gnutls_datum_t *
raw_key);

like, that's the whole vibe. include the header, call the function, live your truth πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie. it's a gnutls session. that's it, that's the arg πŸ’–
  • gnutls_datum_t * raw_key β€” this one's gonna hold the public key. she's an output girlie, she doesn't come with anything, she leaves with everything ✨

πŸ’… DESCRIPTION πŸ’…

okay so listen. this function returns the peer's public key that got used in the last Diffie-Hellman key exchange. the last one. the most recent one. the one that just happened. iykyk πŸ”₯

and the way it works for both anonymous and ephemeral Diffie-Hellman?? versatile queen. she does not discriminate. anonymous DH, ephemeral DH, she said "i got you either way" πŸ‘‘

⚠️ okay important: the output parameters must be freed with gnutls_free(). not free(). not vibes. gnutls_free(). do not skip this, bestie, your memory will simply not slay 😭

and one more lil thing β€” no cap β€” the public key is exported as a non-negative integer, and it may include a leading zero byte. so if you see a sneaky little zero at the front, that's not a bug, that's just her being herself 🫢


⭐ RETURNS ⭐

  • on success, GNUTLS_E_SUCCESS (which is 0) is returned 🌈
  • otherwise? an error code. she'll tell you what went wrong, you just gotta look πŸ’€

πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't be shy, tell the gnutls girlies:

fr fr they wanna know πŸ’œ


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.

(translation: copy it, share it, remix it, just 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, visit

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


and that's the page!! this was gnutls 3.8.13, gnutls_dh_get_pubkey(3), served fresh with love β€” no date on the footer so i'm not gonna invent one, that would be a lie and lying is not iconic πŸ’–βœ¨ bye bestie, go free your gnutls_datum_t πŸŽ€

πŸ“¦ where this page comes from