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 beNULLβ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 π
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
- 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