GNUTLS_X509_CRT_GET_ISSUER_DN_OID(3)

✨ gnutls_x509_crt_get_issuer_dn_oid β€” API function ✨

okay bestie, sit down, hydrate, and let's talk about gnutls_x509_crt_get_issuer_dn_oid(3) πŸ’– this little cutie lives in the gnutls manual (yes, that gnutls, the TLS library, she's iconic) and she has ONE job: pulling OIDs out of a certificate issuer's distinguished name. that's it. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_get_issuer_dn_oid(gnutls_x509_crt_t cert, unsigned
indx, void * oid, size_t * oid_size);

like, look at her. four args. no drama. πŸ¦‹


🫢 ARGUMENTS 🫢

  • gnutls_x509_crt_t cert β€” bestie this should contain a gnutls_x509_crt_t type, that's literally the requirement, don't get cute with it πŸ’…
  • unsigned indx β€” tells us WHICH OID you want back. use (0) to get the very first one, because of course we start at zero, we're not monsters πŸ“
  • void * oid β€” a pointer to a buffer that's gonna hold the OID. and get this: it may be null πŸ‘€
  • size_t * oid_size β€” initially holds the size of oid. initially!! remember that word, it comes back later ✨

πŸ’œ DESCRIPTION πŸ’œ

so what does she actually DO? she extracts the OIDs of the name of the Certificate issuer specified by the given index. that's the mission. that's the whole assignment. πŸ‘‘

and here's the tea, no cap: if oid is null then only the size will be filled. so you can do the classic two-pass thing where you ask "how big is this gonna be" and then actually go get it. main character energy fr fr.

also, the oid returned will be null terminated β€” BUT, and this is the part people miss, oid_size will not account for the trailing null. so don't be out here off-by-one-ing yourself, bestie. 😭


⭐ RETURNS ⭐

  • GNUTLS_E_SHORT_MEMORY_BUFFER β€” your buffer was not long enough, and in that case the buf_size will be updated with the required size. so like, she's not mad, she's just telling you how much room she needs 🫢
  • GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE β€” there are no data in the current index. nothing there. empty. ghost town πŸ’€
  • 0 β€” returned on success. slay. periodt. ✨

πŸŽ€ REPORTING BUGS πŸŽ€

found a bug? don't suffer in silence, tell the people:


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. so yes, you can share her, 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/


ok so lowkey the whole thing in one breath: check the size, allocate, call again, mind the null terminator, and read your return codes. that's it. you ate. πŸ’…

and that's the page, bestie!! πŸ¦‹ this was the gnutls_x509_crt_get_issuer_dn_oid(3) manual page, hanging out in the gnutls manual, version 3.8.13. mwah. go call it with (0) and see what happens. πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from