gnutls_x509_tr..._subject_key_id(3)

πŸ’– gnutls_x509_trust_list_get_issuer_by_subject_key_id πŸ’–

okay bestie, so this one lives in the gnutls manual, section 3, and it's genuinely one of those little functions that does exactly one thing and does it slay. let's get into it 🫢


🌸 NAME 🌸

gnutls_x509_trust_list_get_issuer_by_subject_key_id β€” it's an API function, no cap ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/x509.h>

int
gnutls_x509_trust_list_get_issuer_by_subject_key_id(gnutls_x509_trust_list_t
list, const gnutls_datum_t * dn, const gnutls_datum_t * spki,
gnutls_x509_crt_t * issuer, unsigned int flags);

like. look at her. so much type signature. so much gnutls_datum_t energy πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_trust_list_t list β€” this is the list. the trust list. she's the main character, everything happens inside her.
  • const gnutls_datum_t * dn β€” this is the issuer's DN, and lowkey important note: it may be NULL. so it's optional, bestie, she's flexible like that.
  • const gnutls_datum_t * spki β€” this is the subject key ID. this is the thing you're actually hunting for πŸ”
  • gnutls_x509_crt_t * issuer β€” this pointer will hold the issuer if any. and listen: you have to deallocate it after use. do not just walk away and leave her allocated, that's not the vibe πŸ™ˆ
  • unsigned int flags β€” literally just use zero. that's it. that's the whole instruction. 0. periodt.

✨ DESCRIPTION ✨

so what does she actually do? she finds the issuer that matches the given name and subject key ID. both. together. iconic behavior honestly.

and then β€” this is the part that matters β€” she returns a copy of the issuer. a copy, bestie. which means you own it, and which means you must free it using gnutls_x509_crt_deinit(). if you don't, that's a memory leak and the vibe check will not be passed πŸ’€


⭐ RETURNS ⭐

on success? you get GNUTLS_E_SUCCESS which is 0 🌈

otherwise you get a negative error value. negative. sad girl hours. go read your error string πŸ“


πŸ‘‘ SINCE πŸ‘‘

3.4.2 β€” she's been around a minute, she's a legacy icon, respect her πŸ’œ


😭 REPORTING BUGS 😭

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


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.

(translation: free to share, just keep the receipts, fr fr 🫢)


πŸ”₯ 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 one's from gnutls 3.8.13, manual section 3, and you ate that. go free your issuer with gnutls_x509_crt_deinit() and hydrate. mwah πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from