gnutls_x509_cr...bject_alt_name2(3)
β¨ NAME β¨
gnutls_x509_crt_get_subject_alt_name2 β an API function, bestie π
okay so first things first, this page lives in the gnutls manual (you know, the 3.8.13 era of it), and if you've been squinting at the title bar going "what is gnutls_x509_cr...bject_alt_name2" β that's just the truncated header being dramatic. The real one is the full name up there. π
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_get_subject_alt_name2(gnutls_x509_crt_t cert,
unsigned int seq, void * san, size_t * san_size, unsigned int *
san_type, unsigned int * critical);
π¦ ARGUMENTS π¦
gnutls_x509_crt_t certβ should contain agnutls_x509_crt_ttype. it's the cert you're snooping on, periodt πunsigned int seqβ specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.). yes queen, we're counting from zero, it's giving very index-energy π’void * sanβ is the place where the alternative name will be copied to. empty bucket, ready to receive πͺ£size_t * san_sizeβ holds the size of ret. (that's the size of the buffer you handed over insan, and it gets updated if things go sideways)unsigned int * san_typeβ holds the type of the alternative name (one ofgnutls_x509_subject_alt_name_t). this is the spicy one, more on that in a sec πunsigned int * criticalβ will be non-zero if the extension is marked as critical (may be null). so like, pass a real pointer if you care, orNULLif you don't π
π DESCRIPTION π
This function will return the alternative names, contained in the given certificate. π
It is the same as gnutls_x509_crt_get_subject_alt_name() except for the fact that it will return the type of the alternative name in san_type even if the function fails for some reason (i.e. the buffer provided is not enough).
that last bit is the whole entire plot twist, no cap β the type info still comes through even when everything else refuses. main character energy fr fr β¨
π₯ RETURNS π₯
the alternative subject name type on success, one of the enumerated gnutls_x509_subject_alt_name_t. π
- It will return
GNUTLS_E_SHORT_MEMORY_BUFFERifsan_sizeis not large enough to hold the value. In that casesan_sizewill be updated with the required size. (so it's not a failure-failure, it's a "here's how much room you actually need, bestie" π) - If the certificate does not have an Alternative name with the specified sequence number then
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLEis returned. π
π REPORTING BUGS π
Report bugs to <bugs@gnutls.org>.
Home page: https://www.gnutls.org
not me asking you to actually file the bug instead of just complaining in the group chat π«Ά
π 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.
π 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, slay π this was gnutls 3.8.13, from the gnutls manual β go forth and read those subject alt names, icon of you π§β¨
π¦ 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