GNUTLS_X509_CRT_GET_EXTENSION_DATA(3)

✨ NAME ✨

gnutls_x509_crt_get_extension_data β€” bestie it's an API function πŸ’– (from the gnutls manual, x509 section, iykyk)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/x509.h>

int gnutls_x509_crt_get_extension_data(gnutls_x509_crt_t cert, unsigned
indx, void * data, size_t * sizeof_data);

🌸 ARGUMENTS 🌸

  • gnutls_x509_crt_t cert β€” should contain a gnutls_x509_crt_t type, like that's literally its whole job πŸ’…
  • unsigned indx β€” tells us which extension OID to send. Use (0) to get the first one, okay? start from the top bestie 🫢
  • void * data β€” a pointer to a structure to hold the data (and yes, it may be null, no stress πŸ™ˆ)
  • size_t * sizeof_data β€” initially holds the size of data. it's giving "you tell me how big, I'll tell you how much" energy ✨

πŸ’œ DESCRIPTION πŸ’œ

okay so, this function will return the requested extension data in the certificate. the extension data gets stored in the provided buffer, periodt. πŸŽ€

Use gnutls_x509_crt_get_extension_info() to extract the OID and critical flag. and use gnutls_x509_crt_get_extension_by_oid() instead if you want to get data indexed by the extension OID rather than sequence β€” like, different vibe check, different function, pick your fighter πŸ”₯


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned. otherwise a negative error code is returned 😭. And if you have reached the last extension available, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned β€” so if you see that, congrats bestie, you ran out, there's no more πŸ‘‘


πŸ’€ REPORTING BUGS πŸ’€

Report bugs to <bugs@gnutls.org>. Home page: https://www.gnutls.org

not me telling you to actually email the bugs, but like, fr fr, they want to know πŸ›

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.

iconic behaviour honestly, no royalty, just vibes 🌈

🌟 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/

that's the whole page bestie, slay πŸ’…βœ¨ β€” this was gnutls version 3.8.13, from the gnutls_x509_crt..._extension_data(3) page, mwah, go read the Texinfo manual if you want more πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from