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 initialized gnutls_pcert_st structures. 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 in crt. heads up: this gets updated if necessary, so don't be surprised when it changes on you. πŸ’…
  • unsigned int flags β€” zero, or GNUTLS_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 Β© 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