GNUTLS_X509_CRT_SET_SUBJECT_ALT_NAME(3)

πŸ’– gnutls_x509_crt_set_subject_alt_name(3) πŸ’–

okay bestie, so this is a page from the gnutls manual β€” yes, that gnutls, the TLS library that's literally carrying half the internet on its back πŸ’… β€” and today we're talking about setting the subject alternative name on a certificate. it's giving ✨certificate glow-up✨ energy. let's get into it.


🌸 NAME 🌸

gnutls_x509_crt_set_subject_alt_name β€” an API function. no cap, that's the whole name, that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

#include <gnutls/x509.h>

int gnutls_x509_crt_set_subject_alt_name(gnutls_x509_crt_t crt,
gnutls_x509_subject_alt_name_t type, const void * data, unsigned int
data_size, unsigned int flags);

look at that signature. five arguments. main character energy fr fr. πŸ¦‹


🫢 ARGUMENTS 🫢

  • gnutls_x509_crt_t crt β€” a certificate of type gnutls_x509_crt_t. this is the cert you're about to decorate, bestie πŸŽ€
  • gnutls_x509_subject_alt_name_t type β€” is one of the gnutls_x509_subject_alt_name_t enumerations. pick your fighter, iykyk πŸ’…
  • const void * data β€” The data to be set. literally the content, the moment, the whole point 🌟
  • unsigned int data_size β€” The size of data to be set. gotta tell it how big the vibe is πŸ“
  • unsigned int flags β€” GNUTLS_FSAN_SET to clear previous data or GNUTLS_FSAN_APPEND to append. so like, fresh start or stack it up, your call πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

This function will set the subject alternative name certificate extension. periodt. πŸŽ€

It can set the following types:

  • GNUTLS_SAN_DNSNAME as a text string
  • GNUTLS_SAN_RFC822NAME as a text string
  • GNUTLS_SAN_URI as a text string
  • GNUTLS_SAN_IPADDRESS as a binary IP address (4 or 16 bytes) πŸ”₯
  • GNUTLS_SAN_OTHERNAME_XMPP as a UTF8 string (since 3.5.0)

Since version 3.5.7 the GNUTLS_SAN_RFC822NAME, GNUTLS_SAN_DNSNAME, and GNUTLS_SAN_OTHERNAME_XMPP are converted to ACE format when necessary. yes bestie, ACE format, automatic, no extra work from you β€” slay ✨


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so if you see that 0 you ate and left no crumbs πŸ‘‘


πŸ¦‹ SINCE πŸ¦‹

2.6.0 β€” a certified classic, been iconic since way back πŸ’–


😭 REPORTING BUGS 😭

Report bugs to <bugs@gnutls.org>.

Home page: https://www.gnutls.org

not me asking you to actually email the bugs, but like… if you find one, pls do 🫢 the maintainers are real ones.

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.


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

like, go read the whole thing, it's lowkey a masterpiece πŸ’œ


and that's the page, bestie!! this lil writeup came from gnutls 3.8.13, straight out of the manual that lives at gnutls_x509_crt_set_subject_alt_name(3). go set some subject alt names and be your own main character πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from