gnutls_pkcs7_print(3)

πŸ’… gnutls_pkcs7_print β€” the glow-up your PKCS7 needed

okay bestie, so this is a page from the gnutls manual, and the function we're hyping today is gnutls_pkcs7_print(3). Yes the (3) means it lives in section 3, we love a library call with a lil number attached πŸŽ€


✨ NAME ✨

gnutls_pkcs7_print β€” it's an API function, periodt.


🌸 SYNOPSIS 🌸

#include <gnutls/pkcs7.h>

int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
gnutls_certificate_print_formats_t format, gnutls_datum_t * out);

like. look at her. three little arguments and she's ready to serve 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_pkcs7_t pkcs7 β€” the actual PKCS7 struct you want printed. the main character, fr. she's the one getting the spotlight.
  • gnutls_certificate_print_formats_t format β€” this is you telling it how to print. which vibe are we going for, bestie? you gotta pick.
  • gnutls_datum_t * out β€” a freshly allocated datum, and inside it is a null terminated string. newly allocated!! don't forget that part or it's gonna haunt you 😭

πŸ‘‘ DESCRIPTION πŸ‘‘

so what does she DO. this function pretty prints a signed PKCS 7 structure. pretty prints!! as in, made nice and legible so an actual human can look at it and go "oh okay, I see it." display to a human is literally the whole point. no cap.

currently the supported formats are GNUTLS_CRT_PRINT_FULL and GNUTLS_CRT_PRINT_COMPACT. that's the whole list, don't go inventing new ones πŸ™ˆ

⚠️ IMPORTANT, and I mean this with my whole chest: that out you got? you have to deallocate it yourself with gnutls_free(). it's yours now. she's not gonna clean up after herself, that's a you problem. do it or leak, your choice πŸ’€

⭐ RETURNS ⭐

  • on success you get GNUTLS_E_SUCCESS (which is 0), slay ✨
  • otherwise you get a negative error value, which is the universe's way of saying "no" 😭

🌈 REPORTING BUGS 🌈

found a bug? don't just scream into the void, tell the devs:

they wanna hear it fr fr.


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, go off, just keep the receipts 🧚


πŸ”₯ SEE ALSO πŸ”₯

the full documentation for gnutls is maintained as a Texinfo manual. so if the /usr/share/doc/gnutls/ directory does not have the HTML form, go visit:

https://www.gnutls.org/manual/

that's the plug. iykyk.


mwah πŸ’‹ that's the whole page. this was gnutls version 3.8.13, page gnutls_pkcs7_print(3), and honestly? she ate. go forth and pretty print responsibly, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from