gnutls_x509_crq_get_dn(3)

✨ gnutls_x509_crq_get_dn ✨

okay so this is a page from the gnutls manual (we're on version 3.8.13 bestie, keep up πŸ’…) and it's all about pulling the subject name out of a certificate request. sit down, get comfy, we're doing this 🫢


🌸 NAME 🌸

gnutls_x509_crq_get_dn β€” literally just an API function, no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/x509.h>

int gnutls_x509_crq_get_dn(gnutls_x509_crq_t crq, char * buf, size_t *
buf_size);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_crq_t crq β€” this one should contain a gnutls_x509_crq_t type. that's the whole vibe, it's the cert request you're snooping on πŸ‘€
  • char * buf β€” a pointer to a structure that's gonna hold the name. and yes, it may be NULL, iconic behaviour fr fr
  • size_t * buf_size β€” at first this holds the size of buf. it's like the lil container that tells you how much room you've got πŸ“

πŸ’œ DESCRIPTION πŸ’œ

so what does this actually do? it copies the name of the Certificate request subject into the buffer you handed it. that's it, that's the function, she's simple and she slays ✨

the name comes out looking like this:

"C=xxxx,O=yyyy,CN=zzzz"

which is exactly the form described in RFC 2253, periodt.

the output string buf will be ASCII or UTF-8 encoded, depending on whatever the certificate data is feeling that day 🌈

⚠️ important caveat bestie: this function does not output a fully RFC4514 compliant string. if that's what you need, go see gnutls_x509_crq_get_dn3() instead. different function, different energy πŸ’…

πŸ”₯ RETURNS πŸ”₯

  • GNUTLS_E_SHORT_MEMORY_BUFFER β€” you get this when the buffer you provided isn't long enough 😭 and in that case, * buf_size gets updated with the required size (so like, she's telling you how much room she actually needs, helpful queen πŸ‘‘)
  • 0 β€” success!! we ate. πŸŽ‰

πŸ› REPORTING BUGS πŸ›

found a bug? don't be shy, tell the gnutls girlies:


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.

(no gatekeeping here, the license is giving generous 🫢)


🌟 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 3.8.13, the gnutls_x509_crq_get_dn(3) page β€” go read your cert requests, mwah πŸ’‹

πŸ“¦ where this page comes from