GNUTLS_X509_CRT_GET_ISSUER_ALT_NAME2(3)

πŸ’– gnutls_x509_crt_get_issuer_alt_name2 πŸ’–

okay bestie, sit DOWN, because we're doing a gnutls manpage and it's from the gnutls manual, section 3. this one's about pulling the issuer alternative name out of an X.509 cert. it's giving very specific, very niche, very iconic. let's go πŸŽ€


✨ NAME ✨

gnutls_x509_crt_get_issuer_alt_name2 β€” it's an API function, no cap 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_get_issuer_alt_name2(gnutls_x509_crt_t cert,
unsigned int seq, void * ian, size_t * ian_size, unsigned int *
ian_type, unsigned int * critical);

like yes, that's a lot of arguments. we'll get through them together, i promise πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_crt_t cert β€” should contain a gnutls_x509_crt_t type. that's the cert you're interrogating, bestie πŸ”
  • unsigned int seq β€” specifies the sequence number of the alt name. 0 for the first one, 1 for the second etc. so it's zero-indexed, obviously, we love a zero-indexed queen πŸ‘‘
  • void * ian β€” is the place where the alternative name will be copied to. that's the destination buffer, the little home where the name goes 🏠
  • size_t * ian_size β€” holds the size of ret. (yes it says ret, that's just how it is, we don't question the ancestors πŸ’€)
  • unsigned int * ian_type β€” holds the type of the alternative name, and that type is one of gnutls_x509_subject_alt_name_t πŸ“
  • unsigned int * critical β€” will be non-zero if the extension is marked as critical. it may be null, so you can absolutely pass nothing here if you don't care, no pressure ✨

🌈 DESCRIPTION 🌈

so this function will return the alternative names, contained in the given certificate. it's literally the same as gnutls_x509_crt_get_issuer_alt_name() β€” same energy, same vibe β€” except for the fact that it will return the type of the alternative name in ian_type even if the function fails for some reason (i.e. the buffer provided is not enough). that's the whole glow-up right there. she tells you the type no matter what. main character behaviour, honestly πŸ’…


⭐ RETURNS ⭐

it returns the alternative issuer name type on success, one of the enumerated gnutls_x509_subject_alt_name_t. slay.

and then the plot twists:

  • it will return GNUTLS_E_SHORT_MEMORY_BUFFER if ian_size is not large enough to hold the value. in that case ian_size will be updated with the required size β€” so it's actually being helpful, it's telling you how much room you need 🫢
  • if the certificate does not have an Alternative name with the specified sequence number, then GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned. nothing there, bestie, the data said "not available" and meant it 😭

🧚 SINCE 🧚

2.10.0 β€” old money, been here since forever, respect the elders πŸ‘‘


πŸ™ˆ REPORTING BUGS πŸ™ˆ

Report bugs to <bugs@gnutls.org>.

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

(pls be nice when you email them, they're doing their best πŸ₯Ί)


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, it's free, just keep the receipts πŸŽ€


πŸ‘‘ 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/


ok that's the whole page, every option, every return code, every copyright line, untouched. facts preserved, vibe elevated. that's the rule πŸ’–

and that's a wrap, babe 🌸 this was gnutls 3.8.13, page gnutls_x509_crt...ssuer_alt_name2(3) β€” go forth and read your issuer alt names responsibly. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from