gnutls_x509_crt_print(3)

πŸ’… gnutls_x509_crt_print β€” the manual page, but make it cute

okay bestie, so this is a page from the gnutls manual, and it's literally about making a certificate look pretty for human eyeballs πŸ‘€βœ¨. Yes, that's the whole plot.


✨ NAME ✨

gnutls_x509_crt_print β€” an API function, and she's here to serve πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_print(gnutls_x509_crt_t cert,
gnutls_certificate_print_formats_t format, gnutls_datum_t * out);

there she is. three args, one int, no drama 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_crt_t cert β€” bestie, this is the data to be printed. the main character, honestly.
  • gnutls_certificate_print_formats_t format β€” this one indicates the format to use. you're picking the fit πŸ’…
  • gnutls_datum_t * out β€” a newly allocated datum holding a null terminated string. fresh out the box, and yes you have to clean up after her (more on that below).

πŸ’– DESCRIPTION πŸ’–

So what does she actually do? This function will pretty print an X.509 certificate, and the whole point is that it's suitable for display to a human. Like, readable. For people. Not just for machines to vibe with in silence. 🌈

Now here's the format tea β˜•:

  • If the format is GNUTLS_CRT_PRINT_FULL, then all fields of the certificate will be output, on multiple lines. every single one. no gatekeeping. πŸ‘‘
  • The GNUTLS_CRT_PRINT_ONELINE format will generate one line with some selected fields, which is useful for logging purposes. short, sweet, one-line icon. ⭐
⚠️ and this is the important bit, don't skip it: the output out needs to be deallocated using gnutls_free(). like, you must. don't just leave her hanging, that's not the vibe, that's a memory leak 😭

πŸ”₯ RETURNS πŸ”₯

On success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value, which is the universe's way of saying "not today" πŸ’€


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't suffer in silence, spill 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. (yes bestie, that's the actual permission slip, go off πŸŽ€)


πŸ‘‘ 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, no cap ✨ this was gnutls version 3.8.13, documented for gnutls_x509_crt_print(3) β€” mwah, go print some certs, you ate πŸ’…πŸ’–

πŸ“¦ where this page comes from