gnutls_x509_crt_export2(3)
β¨ gnutls_x509_crt_export2(3) β¨
okay bestie, so this one lives in the gnutls manual, and it's literally the glow-up moment for your certificate β it takes that cert and turns it into something you can actually write out to a file or send somewhere. π
π NAME π
gnutls_x509_crt_export2 β API function
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_export2(gnutls_x509_crt_t cert,
gnutls_x509_crt_fmt_t format, gnutls_datum_t * out);
π¦ ARGUMENTS π¦
gnutls_x509_crt_t certβ this is the certificate you're holding, the main character of the whole operation. πgnutls_x509_crt_fmt_t formatβ the format of the output params, girl. One ofPEMorDER. pick your aesthetic β¨gnutls_datum_t * outβ will contain a certificate that'sPEMorDERencoded. this is where the magic lands, so make sure you hand it a real pointer. π«Ά
π DESCRIPTION π
so this function will export the certificate to DER or PEM format. iconic behaviour, no cap.
the output buffer is allocated using gnutls_malloc(). so yeah, that memory is yours to deal with β it came from gnutls_malloc(), act accordingly. π§
and if the structure is PEM encoded, it will have a header of "BEGIN CERTIFICATE". you know the vibe, the little armour-plated fence around the base64. β
π RETURNS π
In case of failure a negative error code will be returned, and 0 on success. so like β negative means something went wrong, 0 means slay. check it. π
β SINCE β
3.1.3 β she's been around a minute, lowkey a legend. π
π REPORTING BUGS π
Report bugs to <bugs@gnutls.org>.
Home page: https://www.gnutls.org
not me asking you to actually report bugs instead of just complaining in the group chat π they really do want to hear it.
πΈ 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.
π 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 whole page bestie, every flag, every default, every copyright line, untouched and unbothered. periodt. π
this was gnutls_x509_crt_export2(3), served up from gnutls version 3.8.13 β catch you in the next manpage, 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