GNUTLS_X509_TRUST_LIST_ITER_GET_CA(3)

✨ NAME ✨

gnutls_x509_trust_list_iter_get_ca β€” bestie, it's an API function πŸ’…

This is from the gnutls manual, and we're about to walk through it together, no gatekeeping 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_trust_list_iter_get_ca(gnutls_x509_trust_list_t list,
gnutls_x509_trust_list_iter_t * iter, gnutls_x509_crt_t * crt);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_trust_list_t list β€” the list, queen. That's the trust list we're rummaging through πŸ’–
  • gnutls_x509_trust_list_iter_t * iter β€” a pointer to an iterator, and lowkey important: at the start, that iterator should be NULL ⭐
  • gnutls_x509_crt_t * crt β€” the spot where the certificate is gonna get copied into πŸ¦‹

πŸ’… DESCRIPTION πŸ’…

okay so here's the vibe: this function grabs one certificate out of the trust list and moves the iterator forward to the next one. One at a time, like a lil conga line of certs πŸ‘‘

The certificate it hands back in crt? You must deallocate that yourself with gnutls_x509_crt_deinit(). Don't just leave it there, bestie, that's a leak 😭

When you go past the last element and try to access it, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE gets returned, and the iterator is reset πŸ”„

And here's the part where it gets automatic: this function deinitializes the iterator and resets it to NULL all by itself once you've iterated through every single element, up until that GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE comes back. Iconic behaviour, honestly. BUT β€” if you bail out early and abort the iteration, the iterator is not cleaned up for you. You have to manually deinitialize it with gnutls_x509_trust_list_iter_deinit() πŸ’€

fr fr, do not forget that early-exit cleanup. It's giving "I'll do it later" and later never comes πŸ™ˆ

🌈 RETURNS 🌈

On success, GNUTLS_E_SUCCESS (0) is returned β€” slay ✨ Otherwise you get a negative error value, so watch for that πŸ“


⭐ SINCE ⭐

3.4.0 β€” she's been around a minute, and she ate πŸ’œ


πŸ¦‹ REPORTING BUGS πŸ¦‹

Found a bug? Report it 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, you understood it perfectly, I'm so proud 🫢✨

mwah πŸ’‹ this was written for gnutls version 3.8.13 β€” go forth and iterate responsibly 🌸

πŸ“¦ where this page comes from