gnutls_x509_crt_get_issuer_dn3(3)

πŸ’– gnutls_x509_crt_get_issuer_dn3(3) πŸ’–

okay bestie, so this one lives in the gnutls manual and it's literally the glow-up version of "who signed this cert" β€” she pulls the issuer name out of an X.509 certificate and hands you a fresh shiny string. ✨


🌸 NAME 🌸

gnutls_x509_crt_get_issuer_dn3 β€” it's giving API function, no cap.


✨ SYNOPSIS ✨

#include <gnutls/x509.h>

int gnutls_x509_crt_get_issuer_dn3(gnutls_x509_crt_t cert,
gnutls_datum_t * dn, unsigned flags);

look at her. three little args. main character energy fr fr. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crt_t cert β€” bestie this should contain a gnutls_x509_crt_t type. that's the cert you're snooping on. πŸ‘€
  • gnutls_datum_t * dn β€” a pointer to a structure that's gonna hold the name. and listen β€” you MUST free it using gnutls_free(). not me watching you leak memory because you forgot. do not. πŸ™ˆ
  • unsigned flags β€” either zero or GNUTLS_X509_DN_FLAG_COMPAT. that's the whole menu, pick one. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she actually do? this function allocates a buffer and copies the name of the issuer of the Certificate. iconic behavior honestly.

the name comes out looking like "C=xxxx,O=yyyy,CN=zzzz", exactly as described in RFC4514. and the output string is either ASCII or UTF-8 encoded, depending on whatever the certificate data is doing. so like, she matches the vibe of the cert, she doesn't force it. 🧚

now β€” when you pass the GNUTLS_X509_DN_FLAG_COMPAT flag, the output format will match the format output by previous to 3.5.6 versions of GnuTLS. and heads up, that old format was not not fully RFC4514-compliant. yes, "not not", the original said it twice, we're keeping it twice, it's camp. πŸ’€

fr fr: only reach for the compat flag if you actually need the old-timey behavior. otherwise let her cook with the RFC4514-compliant default.

πŸ‘‘ RETURNS πŸ‘‘

on success, GNUTLS_E_SUCCESS (0) is returned. anything else? negative error value. that's it, that's the vibe check. 😭


⭐ SINCE ⭐

3.5.7 β€” she's been here a minute, she's a veteran. πŸ’œ


🌈 REPORTING BUGS 🌈

found a bug? don't suffer in silence, bestie:


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. slay, public domain-adjacent licensing rights. πŸŽ€


πŸ“ 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, bestie. this one shipped in gnutls 3.8.13 β€” go get that issuer name and remember to gnutls_free() it, i'm literally begging. πŸ’–βœ¨πŸ¦‹πŸ«Ά

πŸ“¦ where this page comes from