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. Use 0 for 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 of buf. 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 Β© 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