gnutls_x509_dn_export(3)

πŸ’… gnutls_x509_dn_export β€” bestie edition

okay so welcome to the gnutls manual, specifically the page for gnutls_x509_dn_export(3). this one is a lil API function and honestly she's giving "quiet luxury" β€” short, sweet, does exactly one thing. let's get into it πŸŽ€


✨ NAME ✨

gnutls_x509_dn_export β€” API function πŸ’–

like. that's it. that's the name. iconic of her tbh.


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_dn_export(gnutls_x509_dn_t dn, gnutls_x509_crt_fmt_t
format, void * output_data, size_t * output_data_size);

yes bestie, that's the whole signature. four args, one int return, no notes πŸ’…


🫢 ARGUMENTS 🫢

  • gnutls_x509_dn_t dn β€” this holds the uint8_t DN object. it's the thing you're exporting, the main character of this whole operation ✨
  • gnutls_x509_crt_fmt_t format β€” the format of output params. one of PEM or DER. pick your vibe, there are literally only two πŸŽ€
  • void * output_data β€” will contain a DN PEM or DER encoded. this is where the good stuff lands πŸ“
  • size_t * output_data_size β€” holds the size of output_data, and will be replaced by the actual size of parameters. so it goes in as "how much room do i have" and comes back out as "here's what i actually used" πŸ”₯

πŸ’– DESCRIPTION πŸ’–

so like, this function will export the DN to DER or PEM format. that's the whole job. she shows up, she converts, she leaves. no cap πŸ¦‹

now, the important bit: if the buffer you provided is not long enough to hold the output, then * output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned. so she's not gonna crash out on you β€” she'll tell you exactly how much space she needs and let you try again. queen behavior πŸ‘‘

and if the structure is PEM encoded, it will have a header of "BEGIN NAME". periodt. πŸ’œ

ngl bestie, if you see GNUTLS_E_SHORT_MEMORY_BUFFER you did nothing wrong β€” that's literally the API's way of saying "give me a bigger box" 🎁

⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise a negative error value. so: 0 = slay, negative = go read the error code πŸ’€


πŸ› REPORTING BUGS πŸ›

found a bug? not me being the one to tell you, but like β€” report bugs 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, take her everywhere, just keep the receipt 🧚


πŸ”₯ 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/

okay that's the whole page bestie, you ate that 🫢 this was gnutls_x509_dn_export(3) from gnutls version 3.8.13 β€” go forth and export your DNs, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from