gnutls_x509_crt_list_import(3)
π gnutls_x509_crt_list_import(3) β the manual page, but make it make sense
okay bestie so this is a page from the gnutls manual, and it's about one very specific little function that does a very specific little thing. let's get into it π¦
β¨ NAME β¨
gnutls_x509_crt_list_import β yes it's an API function, that's literally the whole name, she's not hiding anything π
β¨ SYNOPSIS β¨
#include <gnutls/x509.h>
int gnutls_x509_crt_list_import(gnutls_x509_crt_t * certs, unsigned int
* cert_max, const gnutls_datum_t * data, gnutls_x509_crt_fmt_t format,
unsigned int flags);
β¨ ARGUMENTS β¨
gnutls_x509_crt_t * certsβ this is where your parsed list is gonna get copied to. Important: it must not be initialized. like don't touch it first, she needs it fresh. no cap.unsigned int * cert_maxβ at first this has to hold the maximum number of certs. then the function updates it with the number of certs that are actually available. so it's giving in-and-out, a lil two-way street π«Άconst gnutls_datum_t * dataβ the PEM encoded certificate.gnutls_x509_crt_fmt_t formatβ one ofDERorPEM. pick your fighter.unsigned int flagsβ must be0or an OR'd sequence ofgnutls_certificate_import_flags.
β¨ DESCRIPTION β¨
so the whole vibe of this function: it takes the PEM encoded certificate list you handed it and converts it into the native gnutls_x509_crt_t format. the output gets stored in certs. and the bestie part? they will be automatically initialized for you. no manual setup, she just does it β¨
now, the flags. listen up:
- The flag
GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEEDwill cause import to fail if the certificates in the provided buffer are more than the available structures. like, more certs than you made room for = she's not doing it, sorry π - The
GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTEDflag will cause the function to fail if the provided list is not sorted from subject to issuer. sorted or it's over, periodt.
also, if the Certificate is PEM encoded it should have a header of "X509 CERTIFICATE", or "CERTIFICATE". those exact words, bestie, she checks πΈ
β¨ RETURNS β¨
the number of certificates read, or a negative error value. so if it's negative, something went wrong and we're sad π
β¨ REPORTING BUGS β¨
found a bug? report it to <bugs@gnutls.org>.
home page: https://www.gnutls.org
β¨ COPYRIGHT β¨
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. iconic behavior honestly π
β¨ 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 was gnutls version 3.8.13, from the gnutls manual, and yeah that's the whole thing β go read a certificate list or something, i believe in you ππ¦
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms