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 theuint8_tDN 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 ofPEMorDER. pick your vibe, there are literally only two πvoid * output_dataβ will contain a DNPEMorDERencoded. this is where the good stuff lands πsize_t * output_data_sizeβ holds the size ofoutput_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 π
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
- 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