GNUTLS_X509_CRT_GET_EXTENSION_INFO(3)
β¨ NAME β¨
gnutls_x509_crt_get_extension_info β an API function, bestie π (and yes, it lives in section 3 of the gnutls manual, iykyk)
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_get_extension_info(gnutls_x509_crt_t cert, unsigned
indx, void * oid, size_t * oid_size, unsigned int * critical);
π ARGUMENTS π
gnutls_x509_crt_t certβ okay so this should contain agnutls_x509_crt_ttype. that's the vibe. π¦unsigned indxβ tells us which extension OID we're asking for. Use(0)to get the first one, like the very first episode of your fave series. β¨void * oidβ a pointer to a structure that's gonna hold the OID. it's the little house where the OID moves in πsize_t * oid_sizeβ on the way in, it holds the maximum size ofoid. on the way out? it holds the actual size ofoid. glow up, honestly. πunsigned int * criticalβ output variable carrying the critical flag. it may be NULL, no pressure bestie π«Ά
π DESCRIPTION π
So this function returns the requested extension OID in the certificate, plus the critical flag for it. The extension OID gets stored as a string in the buffer you provided. Then use gnutls_x509_crt_get_extension() to extract the actual data β that's a different function, don't mix them up, not me doing that π
If the buffer you provided is not long enough to hold the output, then oid_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned. Sad but honest. π
The oid returned will be null terminated, although oid_size will not account for the trailing null. And heads up β that last part is not true for GnuTLS prior to 3.6.0, so if you're on something ancient, vibe check your version first. β
π₯ RETURNS π₯
On success, GNUTLS_E_SUCCESS (0) is returned β slay. 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. that's it, no more extensions, the list said goodbye π
π REPORTING BUGS π
Found a bug? Report it to <bugs@gnutls.org>. they wanna hear about it fr fr π
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. iconic behavior, honestly π
π§ 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/
okay bestie that's the whole page, every last flag and error code accounted for, no cap π«Άβ¨
gnutls version 3.8.13, hanging out in section 3 of the manual, written on the day the footer says. mwah, take care of your extensions π ππ¦
π¦ 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