gnutls_x509_crt_get_dn_oid(3)
π gnutls_x509_crt_get_dn_oid(3) π
okay bestie so this one lives in the gnutls manual, section 3, and it's literally the glow-up you need when you wanna peek at the OIDs hiding inside a certificate's subject name. no cap. let's get into it π
β¨ NAME β¨
gnutls_x509_crt_get_dn_oid β API function
like, that's the whole name. short, iconic, to the point π
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_get_dn_oid(gnutls_x509_crt_t cert, unsigned indx,
void * oid, size_t * oid_size);
π¦ ARGUMENTS π¦
gnutls_x509_crt_t certβ bestie this one should contain agnutls_x509_crt_ttype. that's the certificate you're snooping on, main character energy fr.unsigned indxβ this tells you which OID to return. use(0)to get the very first one, like the first slide of a carousel π«Ά.void * oidβ a pointer to a buffer that's gonna hold the OID. it may be null, it's giving low-maintenance, we love that.size_t * oid_sizeβ this one initially holds the size ofoid. it's the little planner notebook of the whole operation.
π DESCRIPTION π
so what does it actually do? it will extract the OIDs of the name of the Certificate subject specified by the given index. like, you point at an index, it hands you the OID. slay.
and here's the tea: if oid is null then only the size will be filled. so you can do a little reconnaissance run first, find out how much room you need, then come back with the right buffer. no guessing, we're organized here.
also the oid returned will be null terminated, although oid_size will not account for the trailing null. so the null is there, it's just not in the headcount. the way that the null is present but uncountedβ¦ sneaky little icon π.
β RETURNS β
GNUTLS_E_SHORT_MEMORY_BUFFERβ your buffer said "not long enough bestie", and in that case thebuf_sizewill be updated with the required size. so at least it tells you how much room to bring next time.GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLEβ there are no data in the current index. nothing there. empty. ghosted π.- On success
0is returned. periodt. π
π REPORTING BUGS π
found a bug? don't suffer in silence, report it to <bugs@gnutls.org>. they wanna hear from you, 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, honestly β free to share, just keep the receipts π§
π 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/
ngl, if you got here you're already doing great. go read some certs, bestie πΈ
and that's the whole vibe check β brought to you by gnutls 3.8.13, the gnutls_x509_crt_get_dn_oid(3) page itself. 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