gnutls_pcert_import_x509_list(3)
β¨ gnutls_pcert_import_x509_list β¨
okay bestie, welcome to the gnutls corner of the manual π this one's an API function, and yes it's giving "cryptic C signature" energy but I promise it's so much friendlier than it looks.
π NAME π
gnutls_pcert_import_x509_list β the API function that takes a whole lil squad of certificates and tucks them into your already-allocated gnutls_pcert_st structures. periodt.
πΈ SYNOPSIS πΈ
#include <gnutls/abstract.h>
int gnutls_pcert_import_x509_list(gnutls_pcert_st * pcert_list,
gnutls_x509_crt_t * crt, unsigned * ncrt, unsigned int flags);
π¦ ARGUMENTS π¦
gnutls_pcert_st * pcert_listβ the structures where the certificates get stored. important: it must not contain initializedgnutls_pcert_ststructures. like, do not come in here with already-set-up structs, bestie, that's not the vibe. πgnutls_x509_crt_t * crtβ the certificates you wanna import. the main characters, literally. πunsigned * ncrtβ how many certificates live incrt. heads up: this gets updated if necessary, so don't be surprised when it changes on you. πunsigned int flagsβ zero, orGNUTLS_X509_CRT_LIST_SORT. that's the whole menu, no secret options.
π DESCRIPTION π
so this is a convenience function β its whole job is importing the certificates you hand it into an already allocated set of gnutls_pcert_st structures. it does not allocate them for you, it's not doing your homework, it's just filling in what you already prepped. π«Ά
once you're done with them, you must deinitialize those structures with gnutls_pcert_deinit(). don't skip this, okay? it's the cleanup era and it matters. π§Ήβ¨
also pcert_list needs to have space for at least ncrt elements. at least. if you undersize it, that's on you and the vibes will be bad.
now for the spicy part πΆοΈ: if GNUTLS_X509_CRT_LIST_SORT is specified and the function cannot sort the list, it returns GNUTLS_E_CERTIFICATE_LIST_UNSORTED. currently, sorting can fail if the list size exceeds an internal constraint β that constraint is 16. sixteen. so if you're rolling in with a bigger list than that, know the risk, bestie.
β RETURNS β
on success you get GNUTLS_E_SUCCESS (which is 0), and otherwise you get a negative error value. simple as that. no cap. π―
π SINCE π
3.4.0 β she's been around a minute, an icon of longevity.
π REPORTING BUGS π
found a bug? tell the devs, they wanna know:
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.
π 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 π go forth and import those certificates responsibly, deinit when you're done, and remember: sixteen is the limit for sorting. iykyk. β¨π
this lil love letter came to you from gnutls version 3.8.13 β mwah, catch you in the next manpage π«Άπ
π¦ 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