gnutls_x509_cr...tension_by_oid2(3)
π gnutls_x509_crt_get_extension_by_oid2 π
okay bestie, so this one lives in the gnutls manual, and it's lowkey one of the most useful little x509 helpers you'll ever meet. it's literally the "gimme that one extension, i know its OID" function. no cap. π
β¨ NAME β¨
gnutls_x509_crt_get_extension_by_oid2 β API function π
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_get_extension_by_oid2(gnutls_x509_crt_t cert, const
char * oid, unsigned indx,
gnutls_datum_t * output,
unsigned int * critical);
π¦ ARGUMENTS π¦
gnutls_x509_crt_t certβ this should contain agnutls_x509_crt_ttype, bestie. like, the actual certificate you're digging through. πconst char * oidβ holds an Object Identified in null terminated string. yes, an Object Identified, that's what the original says and i'm not gonna gaslight you about it β it's your OID, as a null terminated string. πunsigned indxβ in case multiple same OIDs exist in the extensions, this specifies which to send. use(0)to get the first one. the way that one certificate can have the same OID more than once is honestly iconic of it. πgnutls_datum_t * outputβ will hold the allocated extension data. it's giving "here's your buffer, it's been allocated for you". πunsigned int * criticalβ will be non-zero if the extension is marked as critical. so basically: truthy = critical, zero = chill. β
π DESCRIPTION π
this function will return the extension specified by the OID in the certificate. periodt.
the extensions will be returned as binary data DER encoded, in the provided buffer. so what you get back is raw DER bytes, not some pretty printed thing β that's on you, babe. π§
π RETURNS π
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise a negative error code is returned. π₯
and listen β if the certificate does not contain the specified extension, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned. so don't panic when you see it, it just means "girl, that extension isn't in there". π
π SINCE π
3.3.8 β she's been around a minute, she's a veteran. π«Ά
π REPORTING BUGS π
found something cursed? report bugs to <bugs@gnutls.org>.
home page: https://www.gnutls.org β go say hi. πΈ
π 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. slay, that's the whole license vibe right there. β¨
π 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/
fr fr, that's everything β every argument, every return code, every copyright line, untouched, just with better vibes. iykyk. π
and that's a wrap, bestie π β this page came straight out of gnutls 3.8.13, so go forth and fetch those extensions. mwah. πβ¨π¦
π¦ 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