gnutls_x509_crt_list_import2(3)
β¨ gnutls_x509_crt_list_import2 β¨
okay bestie, so this is a page from the gnutls manual β yes, that gnutls, the TLS library that's been holding down the internet since forever π
β and today we're looking at gnutls_x509_crt_list_import2(3), which is literally the "turn a blob of certs into actual usable cert objects" function. it's giving API function, it's giving glow-up for your PEM data πΈ
π SYNOPSIS π
#include <gnutls/x509.h>
int gnutls_x509_crt_list_import2(gnutls_x509_crt_t ** certs, unsigned
int * size, const gnutls_datum_t * data, gnutls_x509_crt_fmt_t format,
unsigned int flags);
π ARGUMENTS π
gnutls_x509_crt_t ** certsβ this is where the parsed certificate list is gonna live. it will hold it. it's the main character slot π«Άunsigned int * sizeβ and this one? it will contain the size of the list. like, how many crts are in there. iconic.const gnutls_datum_t * dataβ the PEM encoded certificate. that's the raw input, the vibe before the glow-up.gnutls_x509_crt_fmt_t formatβ one of DER or PEM. pick one, no cap.unsigned int flagsβ must be(0)or an OR'd sequence ofgnutls_certificate_import_flags. no random numbers here bestie, they have to be the actual flags π
π DESCRIPTION π
so like, the way this works: this function will convert the given PEM encoded certificate list to the native gnutls_x509_crt_t format. the output will be stored in certs, which will be allocated and initialized. periodt β¨
if the Certificate is PEM encoded it should have a header of "X509 CERTIFICATE", or "CERTIFICATE". those exact strings, bestie, don't freestyle them π
okay so the cleanup part is lowkey important: to deinitializecerts, you need to deinitialize each crt structure independently, and usegnutls_free()atcerts. not one, not the other β both. it's giving "two-step skincare routine" but for memory π
β RETURNS β
GNUTLS_E_SUCCESS on success, otherwise a negative error code. slay when it works, sad girl hours when it doesn't π
π¦ SINCE π¦
3.0 β she's been here a minute, an OG fr fr.
πΈ REPORTING BUGS πΈ
Report bugs 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.
π 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 came straight out of the gnutls manual, version 3.8.13, dated with the classic gnutls_x509_crt_list_import2(3) header energy π go forth and import those certs, you absolute legend π«Άβ¨
π¦ 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