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 a gnutls_x509_crt_t type. 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 of oid. 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 the buf_size will 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 0 is 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 Β© 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