gnutls_x509_rdn_get_oid(3)
β¨ NAME β¨
gnutls_x509_rdn_get_oid β it's an API function, bestie π
and it's the one that pulls a single Object identifier out of an RDN sequence. Yes queen, we're doing X.509 deep cuts today.
This one lives in the gnutls manual, so if you were looking for gnutls_x509_rdn_get_oid(3), you're in exactly the right place π
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_rdn_get_oid(const gnutls_datum_t * idn, unsigned indx,
void * buf, size_t * buf_size);
π¦ ARGUMENTS π¦
const gnutls_datum_t * idnβ this lil guy should contain a DER encoded RDN sequence. That's the whole vibe. DER, encoded, RDN sequence, no substitutions π₯unsigned indxβ tells us which OID you want back. Use0for the first one, because of course we're zero-indexing, it's giving very much programmer energy πvoid * bufβ a pointer to a structure that's gonna hold the peer's name OID. It's the lil bucket you're handing over πsize_t * buf_sizeβ holds the size ofbuf. Yes, it's a pointer, yes, that matters, we'll get to why in a sec π
π DESCRIPTION π
Okay so real talk: this function will return the specified Object identifier, of the RDN sequence. That's it. That's the whole job. You point at a DER encoded RDN sequence, you say which index you want, and it hands you back the OID. Iconic behaviour, honestly β¨
β RETURNS β
On success, GNUTLS_E_SUCCESS (0) is returned π
BUT β and this is the part where you gotta pay attention, no cap β GNUTLS_E_SHORT_MEMORY_BUFFER is returned and * buf_size is updated if the provided buffer is not long enough. So your buffer was too tiny, and it's politely telling you the size you should have used. Otherwise, you get a negative error value. Negative = not your day π
Pro move: the "short buffer" answer is not always a failure-failure, it's sometimes the "hey bestie here's the real size, try again" signal. But it's still an error return, so check for it, fr fr.
π§ SINCE π§
2.4.0 β an elder. Respect the elders π
π REPORTING BUGS π
Found something cursed? Report bugs to <bugs@gnutls.org> π«Ά
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.
πΈ 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/
and that's the whole page, periodt π go forth and parse your RDNs, you absolute main character π¦β¨
mwah π this was gnutls version 3.8.13, and the man page itself is gnutls_x509_rdn_get_oid(3) β love you, bye!
π¦ 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