gnutls_x509_dn_get_str2(3)

✨ gnutls_x509_dn_get_str2 ✨

okay bestie, welcome to the gnutls manual πŸ’– this one's a little API function page and it's honestly kind of a bop once you get it. it lives in the gnutls manual, so consider this your group chat with the C library 🫢


🌸 NAME 🌸

gnutls_x509_dn_get_str2 β€” literally an API function, that's the whole name, slay πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/x509.h>

int gnutls_x509_dn_get_str2(gnutls_x509_dn_t dn, gnutls_datum_t * str,
                            unsigned flags);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_dn_t dn β€” a pointer to a DN. that's the Distinguished Name we're about to turn into a cute little string ✨
  • gnutls_datum_t * str β€” a datum that will hold the name. it's the container, the lil basket the result goes in 🧺
  • unsigned flags β€” either zero, or GNUTLS_X509_DN_FLAG_COMPAT. pick your vibe, no in-between πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so the way this works: this function will allocate a buffer and copy the name from the DN you handed it into that buffer. no cap, it does the memory thing for you 🫢

the name comes out in the form "C=xxxx,O=yyyy,CN=zzzz", exactly as described in RFC4514. iconic format, we love her πŸ“œ

and the output string will be ASCII or UTF-8 encoded, depending on the certificate data. so like, whatever the cert's been through, the encoding reflects that πŸ’€

🚨 now listen: when the flag GNUTLS_X509_DN_FLAG_COMPAT is specified, the output format will match the format output by versions of GnuTLS previous to 3.5.6 β€” which was not fully RFC4514-compliant. so it's the old-school legacy look, not the fully compliant one. choose accordingly, bestie πŸ™ˆ

⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned πŸŽ‰ otherwise you get a negative error value, which is the library's way of saying "not me being dramatic but something went wrong" 😭


🌈 SINCE 🌈

3.5.7 β€” she's been around, she's a legend πŸ‘‘


πŸ› REPORTING BUGS πŸ›

found a bug? don't gatekeep, report it 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. so like, go forth and 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/

and that's the whole page, bestie πŸ’… this was gnutls_x509_dn_get_str2(3) from the gnutls manual, version 3.8.13, dated the same. go get that DN string, you're the main character fr fr πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from