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 of PEM or DER. pick your aesthetic ✨
  • gnutls_datum_t * out β€” will contain a certificate that's PEM or DER encoded. 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 Β© 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