GNUTLS_X509_CRQ_GET_EXTENSION_INFO(3)

πŸ’… gnutls_x509_crq_get_extension_info(3)

okay bestie, so this one lives in the gnutls manual, section 3, and it's literally all about peeking at extensions inside a certificate request. the way this function just... reads OIDs for you. iconic behaviour, no cap. πŸŽ€


✨ NAME ✨

gnutls_x509_crq_get_extension_info β€” it's an API function, and it's here to hand you the OID of an extension in a CRQ. periodt.


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crq_get_extension_info(gnutls_x509_crq_t crq, unsigned
indx, void * oid, size_t * sizeof_oid, unsigned int * critical);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_crq_t crq β€” this should contain a gnutls_x509_crq_t type. like, that's the whole vibe. 🫢
  • unsigned indx β€” tells us which extension number we want. use (0) to grab the very first one, bestie.
  • void * oid β€” a pointer, and it's where we store the OID. slay.
  • size_t * sizeof_oid β€” on the way in, it holds the maximum size of oid; on the way back out, it holds the actual size of oid. she's got range. πŸ’–
  • unsigned int * critical β€” output variable holding the critical flag. may be NULL, no pressure.

πŸ’œ DESCRIPTION πŸ’œ

so this function returns the requested extension OID that's chillin' inside the certificate, plus the critical flag for it. the extension OID gets stored as a string in the buffer you provided. and if you wanna go get the actual data? use gnutls_x509_crq_get_extension_data() to extract it. iykyk. πŸ”₯

and listen β€” if the buffer you handed over is not long enough to hold the output, then * sizeof_oid gets updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned. so like, don't skimp on the buffer, okay? 😭


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error code in case of an error. and if you've reached the last extension available, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned. that's just the end of the list, babe, not a personal attack. πŸ™ˆ


🌈 SINCE 🌈

2.8.0 β€” she's been here since 2.8.0, a true elder icon. πŸ‘‘


πŸŽ€ 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. so like, keep the receipts, bestie. 🧚


πŸ” 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/


gnutls 3.8.13 β€” and that's the whole page, fr fr. go forth and read those extension OIDs, main character. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from