gnutls_x509_tr..._add_trust_file(3)

πŸ’– NAME πŸ’–

gnutls_x509_trust_list_add_trust_file β€” okay bestie, this is an API function from the gnutls manual (yes, that gnutls, the TLS library, we're being fancy today ✨), and it's literally the girl whose whole job is adding trust files to your trust list 🫢


✨ SYNOPSIS ✨

#include <gnutls/x509.h>

int gnutls_x509_trust_list_add_trust_file(gnutls_x509_trust_list_t list,
const char * ca_file, const char * crl_file, gnutls_x509_crt_fmt_t type,
unsigned int tl_flags, unsigned int tl_vflags);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_trust_list_t list β€” the list, babes. The one we're adding stuff to πŸ’…
  • const char * ca_file β€” a file holding a list of CAs. It's optional, so like, no pressure 🌸
  • const char * crl_file β€” a file holding a list of CRLs. Also optional. Both or neither, your call ✨
  • gnutls_x509_crt_fmt_t type β€” the format of the certificates. Gotta tell her what she's looking at πŸ‘€
  • unsigned int tl_flags β€” flags from gnutls_trust_list_flags_t
  • unsigned int tl_vflags β€” these are gnutls_certificate_verify_flags, but only relevant if your flags specifies GNUTLS_TL_VERIFY_CRL. Otherwise, girl, they're just vibing πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

So what does she actually do. This function will add the given certificate authorities to the trusted list. That's the whole plot 🎬

And plot twist β€” PKCS 11 URLs are also accepted, instead of files, by this function. Not just files, bestie, URLs too. We love versatility ✨

A PKCS 11 URL implies a trust database (and by that I mean a specially marked module in p11-kit, iykyk). And the URL "pkcs11:" implies all trust databases in the system β€” yes, all of them, she's ambitious πŸ’…

⚠️ but listen closely: Only a single URL specifying trust databases can be set; they cannot be stacked with multiple calls. So don't go calling her twice thinking you're being efficient, because you're not, and she will not be stacking them for you 😭 periodt.

πŸ“ RETURNS πŸ“

The number of added elements is returned. That's it, that's the return value, she's telling you how many she brought home 🫢


🌈 SINCE 🌈

3.1 β€” she's been iconic since 3.1, an OG πŸ‘‘


πŸ› REPORTING BUGS πŸ›

Found a bug? Do not suffer in silence, tell the girlies:


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. Slay, honestly β€” no royalty, no drama, just free as in freedom πŸ’–


πŸ¦‹ 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 β€” no notes πŸ’… this was gnutls 3.8.13 energy, brought to you straight from the gnutls manual, mwah πŸ˜˜πŸ’œ

πŸ“¦ where this page comes from