gnutls_certifi..._x509_trust_mem(3)

πŸ’– gnutls_certifi..._x509_trust_mem(3) πŸ’–

okay bestie, welcome to the gnutls manual, we're doing the ✨ trust store thing ✨ today. it's giving certificate authority energy. let's get into it 🫢


✨ NAME ✨

gnutls_certificate_set_x509_trust_mem β€” an API function, and honestly? a whole vibe. it's the one that sets up your trusted CAs straight from memory πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/gnutls.h>

int
gnutls_certificate_set_x509_trust_mem(gnutls_certificate_credentials_t
res, const gnutls_datum_t * ca, gnutls_x509_crt_fmt_t type);

like. look at her. she's so little and she does SO much πŸ₯Ή


🌸 ARGUMENTS 🌸

  • gnutls_certificate_credentials_t res β€” is a gnutls_certificate_credentials_t type. yes babe, that's the credentials object, the main character of this whole story πŸ‘‘
  • const gnutls_datum_t * ca β€” is a list of trusted CAs or a DER certificate. so either a whole lil squad of CAs or just one single DER cert, dealer's choice ✨
  • gnutls_x509_crt_fmt_t type β€” is DER or PEM. that's it, those are the two options, pick your format bestie πŸŽ€

πŸ’– DESCRIPTION πŸ’–

so what does she actually DO. this function adds the trusted CAs in order to verify client or server certificates. that's the whole job. that's the assignment. and she ate πŸ”₯

in case of a client, this is not required to be called if the certificates are not verified using gnutls_certificate_verify_peers2(). like, if you're not checking peers, you can just... not. no pressure, no stress πŸ¦‹

also, this function may be called multiple times. so you can just keep stacking, keep adding, she'll take it all πŸ’…

in case of a server, the CAs set here will be sent to the client if a certificate request is sent. so the server's like "hey client, here's who I trust πŸ‘€". and this can be disabled using gnutls_certificate_send_x509_rdn_sequence() if you're not feeling it.


⭐ RETURNS ⭐

the number of certificates processed β€” or a negative error code on error 😭

so if you get a negative number back, that's not a count, that's a situation. check it, bestie.


πŸ› REPORTING BUGS πŸ›

found a bug? not the cute kind? report it to <bugs@gnutls.org>. they wanna know fr fr πŸ™ˆ

home page: https://www.gnutls.org β€” go say hi 🏠


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, share it, remix it, 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/

go read it, i know you want to 🌈


πŸ’€ reminder: this page is gnutls_certifi..._x509_trust_mem(3) β€” yes the title is truncated with the lil dots, that's just how the man page do. don't come for her.

and that's the whole page bestie!! this was gnutls version 3.8.13, so if you're reading this in some other version, lowkey check the docs. mwah, love u, go set some trusted CAs πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from