gnutls_x509_crl_iter_crt_serial(3)

πŸ’– gnutls_x509_crl_iter_crt_serial β€” the gnutls manual, bestie edition πŸ’–

okay so you're in the gnutls manual (that's the GNU TLS library, she's iconic, she's been holding down the fort since forever) and you clicked on this page, which means you wanna talk about CRL serial numbers and iterating over them like a main character. let's go. ✨


🌸 NAME 🌸

gnutls_x509_crl_iter_crt_serial β€” API function

no cap, that's literally the whole name. it's a function. it does a thing. we'll get there. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/x509.h>

int gnutls_x509_crl_iter_crt_serial(gnutls_x509_crl_t crl,
gnutls_x509_crl_iter_t * iter, unsigned char * serial, size_t *
serial_size, time_t * t);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crl_t crl β€” should contain a gnutls_x509_crl_t type. yeah bestie, the parameter is the type, we know, we know. it's the CRL you're reading from. πŸ“
  • gnutls_x509_crl_iter_t * iter β€” a pointer to an iterator. initially the iterator should be NULL β€” like, before your first call? leave it NULL, she'll handle herself from there. the iterator is the little bookmark that remembers where you are between calls. 🫢
  • unsigned char * serial β€” where the serial number will be copied. this is the output spot, the lil envelope the serial gets dropped into. πŸ’Œ
  • size_t * serial_size β€” initially holds the size of serial. so you tell it how much room you've got, and it uses that. πŸ“
  • time_t * t β€” if non null, will hold the time this certificate was revoked. optional! pass NULL if you don't care, no judgement. ⏰

✨ DESCRIPTION ✨

so this function does the exact same thing as gnutls_x509_crl_get_crt_serial(), but plot twist: it reads sequentially and keeps state in the iterator between calls. it's giving "I remember where we left off." 🧠✨

the way that this matters: it gives you better performance in sequences with many elements (50000+). so if you've got a CRL with fifty thousand entries and you're looping through them one by one, this is the move. periodt. πŸ”₯

when you go past the last element and try to access it, you get GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE back, and the iterator gets reset. so it doesn't just leave you hanging, it politely closes the book and puts the bookmark back at the start. 😭 so thoughtful.

after use, the iterator must be deinitialized using gnutls_x509_crl_iter_deinit(). bestie do NOT forget this one, it's not optional, it's the cleanup step, it's washing your face before bed. 🧼

πŸ’… RETURNS πŸ’…

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value, which is your cue to go check what went wrong. no vibe, only bug. πŸ’€


πŸ› REPORTING BUGS πŸ›

found something cursed? 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. (yes, she's free, she's generous, she's a giver. 🎁)


🌈 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 ate it, you understood the assignment. this was gnutls 3.8.13, gnutls_x509_crl_iter_crt_serial(3) β€” mwah, take care of your iterators, deinit them, hydrate, and I'll see you in the next manpage. πŸŽ€πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from