GNUTLS_X509_CRT_GET_EXTENSION_BY_OID(3)
β¨ gnutls_x509_crt_get_extension_by_oid β the manual page bestie π
okay so this is a page from the gnutls manual (you know, the TLS library, she's iconic, she's giving secure-connection main character energy) π and we're about to get into one very specific little function. buckle up, it's actually not that deep, i promise. β¨
πΈ NAME πΈ
gnutls_x509_crt_get_extension_by_oid β bestie, it's an API function π
π¦ SYNOPSIS π¦
#include <gnutls/x509.h>
int gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt_t cert, const
char * oid, unsigned indx, void * buf, size_t * buf_size, unsigned int *
critical);
like look at her. five-ish params, one int return, no drama. π«Ά
π ARGUMENTS π
gnutls_x509_crt_t certβ this one should contain agnutls_x509_crt_ttype. that's the certificate you're snooping around in. πconst char * oidβ holds an Object Identified in a null terminated string. yes, that's exactly how the original words it, and yes we're keeping it fr fr. πunsigned indxβ so like, in case multiple same OIDs exist in the extensions, this specifies which to send. use(0)to get the first one. because apparently some certs are extra and have duplicates πvoid * bufβ a pointer to a structure to hold the name (it may be null). ngl, "name" is what the original says here, we're not gonna fight it. π§Ίsize_t * buf_sizeβ initially holds the size ofbuf. it knows how big the buffer is before you start, so be honest with it. πunsigned int * criticalβ will be non-zero if the extension is marked as critical. so basically a little flag that goes π when something's marked critical. π¨
π DESCRIPTION π
so the whole vibe of this function is: it will return the extension specified by the OID in the certificate. and the extensions will be returned as binary data DER encoded, in the provided buffer. that's it, that's the whole thing, no cap. π
β RETURNS β
on success, GNUTLS_E_SUCCESS (0) is returned. slay. otherwise a negative error code is returned, which is the universe telling you no. π
and if the certificate does not contain the specified extension, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned. so like, the data you asked for? not available. it said what it said. π
π REPORTING BUGS π
found a bug? report it to <bugs@gnutls.org>. they wanna hear about it, for real.
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. (yes that's the whole legal bit, verbatim, because we do not mess with license text, ever.) ππ
π SEE ALSO π
the full documentation for gnutls is maintained as a Texinfo manual. so if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:
https://www.gnutls.org/manual/
go read it, it's giving lore. ππ¦
okay that's the whole page bestie, every flag, every return code, every link, all of it, preserved like a pressed flower πΈ
this was pulled from the gnutls manual, version 3.8.13, and the page itself is the gnutls_x509_crt_get_extension_by_oid(3) entry β the copyright line up there runs 2001-2023, so that's our date energy π. mwah, go get those 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