gnutls_x509_crt_get_serial(3)

πŸ’– gnutls_x509_crt_get_serial πŸ’–

okay so bestie, welcome to the gnutls manual, and today's main character is gnutls_x509_crt_get_serial β€” she's an API function and she's here to spill the tea on a cert's serial number. pull up a chair, grab a strawberry πŸ“, let's go.


✨ NAME ✨

gnutls_x509_crt_get_serial β€” API function πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_get_serial(gnutls_x509_crt_t cert, void * result,
size_t * result_size);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crt_t cert β€” this one "should contain a gnutls_x509_crt_t type". like, that's the vibe it needs to have. it's the cert you're interrogating πŸ’…
  • void * result β€” the place where the serial number will be copied. this is where she drops the goods 🫢
  • size_t * result_size β€” holds the size of the result field. it knows how much room there is ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this function will return the X.509 certificate's serial number. iconic. it's obtained by the X509 Certificate serialNumber field.

and here's the important part, no cap: serial is not always a 32 or 64bit number. some CAs use large serial numbers, so it may be wise to handle it as something uint8_t. like, don't assume it's gonna fit in a cute little int, because she's built different and might be huge πŸ˜­πŸ‘‘


🌈 RETURNS 🌈

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value and honestly? we don't love that for us. πŸ’€


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't be shy, 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. periodt. πŸ’…


⭐ 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!! πŸŽ€ this lil beauty lives in gnutls 3.8.13 β€” yeah, that's the source and version, mwah πŸ’‹ go get those serial numbers, you absolute icon πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from