gnutls_x509_crt_list_import_url(3)

πŸ’– gnutls_x509_crt_list_import_url(3) β€” the gnutls manual πŸ’–

okay bestie, sit down, we're doing PKCS11 certificate chain imports and honestly? it's giving ✨main character energy✨


🌸 NAME 🌸

gnutls_x509_crt_list_import_url β€” an API function, and yes it does exactly what it says on the tin πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/x509.h>

int gnutls_x509_crt_list_import_url(gnutls_x509_crt_t ** certs, unsigned
int * size, const char * url, gnutls_pin_callback_t pin_fn, void *
pin_fn_userdata, unsigned int flags);

look at that signature. six whole parameters. she's thriving πŸ’…


πŸ‘‘ ARGUMENTS πŸ‘‘

  • gnutls_x509_crt_t ** certs β€” bestie this is where the allocated certificate list is gonna live when we're done. she gets filled in, you don't fill her. 🫢
  • unsigned int * size β€” and this one is gonna hold the size of the list. so you know how many you got. iconic.
  • const char * url β€” a PKCS 11 url. that's the vibe. πŸ”₯
  • gnutls_pin_callback_t pin_fn β€” a PIN callback, but only if one isn't already globally set. iykyk 🌈
  • void * pin_fn_userdata β€” the parameter you pass along for the PIN callback. give her something to work with. πŸ’œ
  • unsigned int flags β€” one of the GNUTLS_PKCS11_OBJ_* flags for PKCS11 URLs, or just zero otherwise. no cap.

✨ DESCRIPTION ✨

okay so here's the tea: this function imports a certificate chain that's chilling inside a PKCS11 token β€” or honestly any type of back-end that supports URLs, we're not gatekeeping πŸ¦‹

⚠️ BIG IMPORTANT ONE, bestie: the certificates must be deinitialized afterwards using gnutls_x509_crt_deinit() and the returned pointer must be freed using gnutls_free(). do not skip this. do not forget this. this is the part where you either slay or you leak memory and cry. 😭

and the URI you provide must be the first certificate in the chain. the subsequent certificates get retrieved using gnutls_pkcs11_get_raw_issuer() or equivalent functionality for whatever URI type you're working with. she starts at the front and walks the whole chain, periodt. πŸ‘‘


⭐ RETURNS ⭐

on success you get GNUTLS_E_SUCCESS (0) back πŸŽ‰ otherwise it's a negative error value and you should go read the error. ngl the negative ones are always the ones you actually care about.


πŸŽ€ SINCE πŸŽ€

3.6.3 β€” a vintage. an old queen. respect her. πŸ’–


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? do NOT suffer in silence, tell the people:


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 off, 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/

that's the mothership. go there. she has everything. πŸ‘‘


and that's the whole page, bestie!! this was the gnutls manual, page for gnutls_x509_crt_list_import_url, brought to you by gnutls 3.8.13. now go deinit your certs. i'm literally begging. πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from