gnutls_certificate_get_issuer(3)

πŸ’– gnutls_certificate_get_issuer β€” bestie, let's find that cert's parent πŸ’–

okay so this is a page from the gnutls manual, and we're about to learn how to ask a certificate who made you πŸ‘‘ no cap, this is the function that hands you the issuer. let's go πŸ¦‹


✨ NAME ✨

gnutls_certificate_get_issuer β€” API function πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

int gnutls_certificate_get_issuer(gnutls_certificate_credentials_t sc,
gnutls_x509_crt_t cert, gnutls_x509_crt_t * issuer, unsigned int flags);

like. it's giving very "one function, four arguments, zero drama" ✨


✨ ARGUMENTS ✨

  • gnutls_certificate_credentials_t sc β€” bestie this is a gnutls_certificate_credentials_t type. that's the vibe. πŸŽ€
  • gnutls_x509_crt_t cert β€” the certificate you want to find the issuer for. the main character, honestly. 🌸
  • gnutls_x509_crt_t * issuer β€” will hold the issuer if there is one. and listen β€” you should treat it as constant. do not go messing with it, okay? πŸ™ˆ
  • unsigned int flags β€” use zero, or GNUTLS_TL_GET_COPY. that's the whole menu. pick one. πŸ“

✨ DESCRIPTION ✨

so this function returns the issuer of a given certificate. literally that's the job. πŸ’–

and here's the part you cannot skip, bestie: if the flag GNUTLS_TL_GET_COPY is specified, a copy of the issuer gets returned, and that copy must be freed using gnutls_x509_crt_deinit(). in that case the issuer you passed in must not be initialized. like, don't pre-init it. don't. 🫢

also, just like gnutls_x509_trust_list_get_issuer(), this function requires the GNUTLS_TL_GET_COPY flag in order to operate with PKCS11 trust lists in a thread-safe way. no flag, no thread-safe PKCS11 vibes. iykyk πŸ’€

✨ RETURNS ✨

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value. classic. 😭


✨ SINCE ✨

3.0 ⭐ β€” she's been here a while, an icon, a legend.


✨ REPORTING BUGS ✨

found a bug? don't suffer in silence, bestie 😭 report bugs to <bugs@gnutls.org>.

home page: https://www.gnutls.org 🌈


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, go forth, but 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/

and that's the whole page, periodt πŸ’… this was the gnutls 3.8.13 version of gnutls_certificate_get_issuer(3) β€” go find those issuers, you ate πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from