gnutls_x509_crt_get_dn3(3)
π gnutls_x509_crt_get_dn3(3) π
okay bestie, so this one lives in the gnutls manual (that's the manual name, keeping it cute for you) and it's literally just... getting the Distinguished Name out of a certificate. the whole vibe. let's go π¦
β¨ NAME β¨
gnutls_x509_crt_get_dn3 β API function. that's it, that's the name, no notes π
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_get_dn3(gnutls_x509_crt_t cert, gnutls_datum_t * dn,
unsigned flags);
look at that signature, she's giving three arguments and a dream β¨
π ARGUMENTS π
gnutls_x509_crt_t certβ this one should contain agnutls_x509_crt_ttype. that's the whole job. that's the assignment. πgnutls_datum_t * dnβ a pointer to a structure that's gonna hold the name. heads up bestie, you must free it usinggnutls_free(). it is not a "leak it and hope" situation, it is a "you own this memory now" situation. π«Άunsigned flagsβ either zero, orGNUTLS_X509_DN_FLAG_COMPAT. pick your fighter. no cap. β
π DESCRIPTION π
so what does she actually do? this function will allocate a buffer and copy the name of the Certificate into it. iconic behaviour honestly.
the name comes out in the form "C=xxxx,O=yyyy,CN=zzzz" β exactly like RFC4514 describes it. we love a standards-compliant moment.
the output string is going to be ASCII or UTF-8 encoded, depending on what's in the certificate data. it's giving "we'll see what the cert says" energy and honestly? respect. π§
now here's the fun part. when you pass the flag GNUTLS_X509_DN_FLAG_COMPAT, the output format will match the format that was output by versions of GnuTLS previous to 3.5.6 β which was not not fully RFC4514-compliant. (yes, the original really said "not not". we are preserving the lore. it was not fully compliant. that's the tea. π)
π₯ RETURNS π₯
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value. that negative number is your sign from the universe that something went sideways. π
π SINCE π
3.5.7 β she's been around. a legacy icon. π
π REPORTING BUGS π
found a bug? don't be shy, report it to <bugs@gnutls.org>.
home page is right here: https://www.gnutls.org β go say hi. π«Ά
β 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. so like, share it, remix it, just keep the receipts. periodt. π
π¦ 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/
go read it. it's giving educated. β¨
and that's the whole page bestie π this was brought to you by gnutls 3.8.13, from the gnutls_x509_crt_get_dn3(3) page β now go free that datum with gnutls_free() before you forget, i am literally begging you. mwah. ππΈπ«Ά
π¦ 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