gnutls_x509_crt_export(3)
π gnutls_x509_crt_export(3) π
okay so bestie, welcome to the gnutls manual, and today's main character is gnutls_x509_crt_export β she's an API function and she's literally here to hand you your certificate in a cute little package. sit down, hydrate, let's go π«Ά
β¨ SYNOPSIS β¨
#include <gnutls/x509.h>
int gnutls_x509_crt_export(gnutls_x509_crt_t cert, gnutls_x509_crt_fmt_t
format, void * output_data, size_t * output_data_size);
that's the whole vibe. one function, four args, no drama π
πΈ ARGUMENTS πΈ
gnutls_x509_crt_t certβ this one holds the certificate, she's the source of truth, the queen, the one we're exporting from πgnutls_x509_crt_fmt_t formatβ the format of output params. One ofPEMorDER. pick your fighter, bestie, those are the only two β¨void * output_dataβ will contain a certificatePEMorDERencoded. this is the lil bucket where your output goes πͺ£size_t * output_data_sizeβ holds the size ofoutput_data(and will be replaced by the actual size of parameters). so she comes in holding a number and leaves holding a different number. glow-up fr fr π
π¦ DESCRIPTION π¦
This function will export the certificate to DER or PEM format. that's it, that's the job, and she does it flawlessly no cap.
now, the important bit β the vibe check on your buffer: if the buffer 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 likeβ¦ she's not gonna crash out, she's just gonna tell you "too small bestie, here's how much room I actually need" and hand the number back to you through that pointer. iconic behaviour honestly π
and if the structure is PEM encoded, it will have a header of "BEGIN CERTIFICATE" β you know the one, the classic. periodt. π
β RETURNS β
In case of failure a negative error code will be returned, and 0 on success. so if you see 0, we ate. if you see a negative number, something went sideways and we're investigating ππ
π REPORTING BUGS π
found a bug? not me gatekeeping the contact info:
- 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.
(translation: share her, remix her, 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 whole page, bestie β no notes, she's perfect π«Ά
mwah π this was gnutls 3.8.13, page gnutls_x509_crt_export(3), brought to you by the gnutls manual. go forth and export responsibly π
β¨
π¦ 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