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 withgnutls_free(). notfree(). 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 is0) 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:
- report bugs to <bugs@gnutls.org>
- home page: https://www.gnutls.org
fr fr they wanna know π
π COPYRIGHT π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms