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 ofoutput_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 π
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
- 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