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 agnutls_x509_crt_ttype. 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 usinggnutls_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 β¨
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms