gnutls_x509_crt_get_dn2(3)

πŸ’– gnutls_x509_crt_get_dn2(3) πŸ’–

okay bestie, welcome to the gnutls manual, this one's a little function called gnutls_x509_crt_get_dn2 and it's literally about pulling a name out of a certificate. let's get into it πŸŽ€


✨ NAME ✨

gnutls_x509_crt_get_dn2 β€” API function πŸ‘‘


✨ SYNOPSIS ✨

#include <gnutls/x509.h>

int gnutls_x509_crt_get_dn2(gnutls_x509_crt_t cert, gnutls_datum_t *
dn);

✨ ARGUMENTS ✨

  • gnutls_x509_crt_t cert β€” should contain a gnutls_x509_crt_t type. like, that's the certificate you're asking about, she's the main character here πŸ’…
  • gnutls_datum_t * dn β€” a pointer to a structure to hold the name; must be freed using gnutls_free(). this is the important part bestie, if you don't free it that's a memory leak and we do NOT do that in this house 😭

✨ DESCRIPTION ✨

so what does she actually do? this function will allocate a buffer and copy the name of the Certificate into it. iconic behavior honestly πŸ¦‹

the name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as described in RFC4514. and the output string will be ASCII or UTF-8 encoded, depending on the certificate data β€” so it depends on the vibes of the cert, no cap ✨

heads up bestie: this function does not output a fully RFC4514 compliant string. if that's what you need, go see gnutls_x509_crt_get_dn3() instead. she's the upgrade πŸ’…

✨ RETURNS ✨

on success, GNUTLS_E_SUCCESS (0) is returned 🌸 otherwise you get a negative error value, which is the universe telling you something went wrong πŸ™ˆ


✨ SINCE ✨

3.1.10 β€” she's been around a minute, a true veteran 🫢


✨ REPORTING BUGS ✨

found a bug? 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. slay, that's genuinely so generous of them πŸ’œ


✨ 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/

okay that's the whole page bestie, you ate that πŸ’…βœ¨ this was gnutls_x509_crt_get_dn2(3) from the gnutls manual, version 3.8.13 β€” go forth and get those distinguished names, no cap πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from