gnutls_pkcs7_export(3)

πŸ’– gnutls_pkcs7_export β€” like, the API function πŸ’–

okay bestie, sit down, hydrate, and let me tell you about gnutls_pkcs7_export from the gnutls manual. it lives in the pkcs7 part of the library and it's literally the glow-up station where your pkcs7 structure gets turned into bytes you can actually ship. πŸŽ€


✨ SYNOPSIS ✨

#include <gnutls/pkcs7.h>

int gnutls_pkcs7_export(gnutls_pkcs7_t pkcs7, gnutls_x509_crt_fmt_t
format, void * output_data, size_t * output_data_size);

🌸 ARGUMENTS 🌸

  • gnutls_pkcs7_t pkcs7 β€” the pkcs7 type. that's the main character you're exporting. πŸ’…
  • gnutls_x509_crt_fmt_t format β€” the format of output params. it's one of PEM or DER, pick your fighter. ✨
  • void * output_data β€” will contain a structure PEM or DER encoded. this is where the magic lands. πŸͺ„
  • size_t * output_data_size β€” holds the size of output_data (and will be replaced by the actual size of parameters). so it goes in as your capacity and comes back out as the truth. πŸ”₯

πŸ¦‹ DESCRIPTION πŸ¦‹

This function will export the pkcs7 structure to DER or PEM format. no cap, that's the whole job and it does it beautifully.

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, it's not being rude, it's just telling you the real size and asking you to try again with more room. 😭 the way that buffer said "not enough room bestie" β€” iconic honestly.

If the structure is PEM encoded, it will have a header of "BEGIN PKCS7". periodt. that's the header, exactly that, no extra vibes. πŸ‘‘


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so 0 is the slay, negative is the "girl something went wrong". πŸ’€


πŸ™ˆ REPORTING BUGS πŸ™ˆ

Report bugs to <bugs@gnutls.org>.

Home page: https://www.gnutls.org


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, royalty-free, go off, redistribute responsibly. 🫢)


🌈 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/

like, that's the link, go read the whole thing, it's giving encyclopedia but make it cute. πŸ“šβœ¨


k bye bestie, that's the whole page!! this was the gnutls_pkcs7_export(3) man page from the gnutls manual, version 3.8.13. mwah, go export something gorgeous. πŸ’–πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from