GNUTLS_X509_TRUST_LIST_ADD_NAMED_CRT(3)

πŸ’– NAME πŸ’–

gnutls_x509_trust_list_add_named_crt β€” it's an API function, bestie, and it's giving "let me introduce you to a very specific trusted cert" energy ✨

This page lives in section 3 of the gnutls manual, so you already know it's a library call and not a command you type into your shell. 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_trust_list_add_named_crt(gnutls_x509_trust_list_t list,
       gnutls_x509_crt_t cert, const void * name, size_t name_size, unsigned
       int flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_trust_list_t list β€” the list. Your trust list. The main character of this whole situation. πŸ‘‘
  • gnutls_x509_crt_t cert β€” a certificate. Just a cert, living its life, about to get a name tag. 🏷️
  • const void * name β€” an identifier for the certificate. This is the name you're matching it to, iykyk.
  • size_t name_size β€” the size of the identifier. Because name is a void * and nobody's counting for you. 😭
  • unsigned int flags β€” should be 0. That's it. That's the whole vibe. Zero. ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: this function will add the given certificate to the trusted list and associate it with a name. Not just "trusted, periodt" β€” trusted for that specific name. πŸ’…

Here's the important part though, so don't skip it: the certificate will not be used for verification with gnutls_x509_trust_list_verify_crt(). Nope. Instead it gets used with gnutls_x509_trust_list_verify_named_crt() β€” or with gnutls_x509_trust_list_verify_crt2(), but that one only since GnuTLS 3.4.0, and only if a hostname is provided. Noted, bestie. πŸ“

In principle, this function can be used to set individual "server" certificates that are trusted by the user for that specific server but for no other purposes. So like… one cert, one server, exclusive relationship. No sharing. 🚫

The certificate cert must not be deinitialized during the lifetime of the list. Like, do not. It has to stay alive the whole time or everything falls apart. πŸ’€

🌈 RETURNS 🌈

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. So if you get a negative number back, that's your sign something went sideways. πŸ™ˆ


⭐ SINCE ⭐

3.0.0 β€” old money, honestly. Iconic since day one. πŸ‘‘


πŸ’œ REPORTING BUGS πŸ’œ

Found a bug? Report it to <bugs@gnutls.org>. They want to hear from you, fr fr. πŸ›

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. Slay, honestly β€” free to share, just 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 whole page, bestie β€” gnutls version 3.8.13, straight from the gnutls_x509_tru...t_add_named_crt(3) corner of the manual. Go forth and name your certs responsibly. πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from