GNUTLS_PCERT_LIST_IMPORT_X509_FILE(3)
β¨ NAME β¨
gnutls_pcert_list_import_x509_file β an API function, bestie π
(this one lives in the gnutls manual, and honestly? she's a baddie)
π SYNOPSIS π
#include <gnutls/abstract.h>
int gnutls_pcert_list_import_x509_file(gnutls_pcert_st * pcert_list,
unsigned * pcert_list_size, const char * file, gnutls_x509_crt_fmt_t
format, gnutls_pin_callback_t pin_fn, void * pin_fn_userdata, unsigned
int flags);
π ARGUMENTS π
gnutls_pcert_st * pcert_listβ the structures where the certs get stored, okay? And listen: it must not contain already-initializedgnutls_pcert_ststructures. Fresh out the box, no cap π βοΈunsigned * pcert_list_sizeβ at first this has to hold the maximum number of certs. Then it gets updated with the number of certs that are actually available. So it goes in as a limit and comes out as a headcount, she's doing double duty fr fr πconst char * fileβ a file or a supported URI with the certificates to load πΈgnutls_x509_crt_fmt_t formatβ eitherGNUTLS_X509_FMT_DERorGNUTLS_X509_FMT_PEM, but only if a file is given β¨gnutls_pin_callback_t pin_fnβ a PIN callback, for when it's not globally set π«Άvoid * pin_fn_userdataβ the parameter for the PIN callback, obviously πunsigned int flagsβ zero, or flags fromgnutls_certificate_import_flagsπ¦
π DESCRIPTION π
Okay so this convenience function will import a certificate chain from the given file (or supported URI) straight into gnutls_pcert_st structures. Iconic behaviour, truly.
Heads up bestie: those structures must be deinitialized afterwards using gnutls_pcert_deinit(). Not optional, she needs her cleanup π
And the little detail that matters: this function will always return a sorted certificate chain. Always. Sorted. Ate and left no crumbs β
π RETURNS π
On success, GNUTLS_E_SUCCESS (0) is returned π otherwise you get a negative error value. And if the pcert list doesn't have enough space, GNUTLS_E_SHORT_MEMORY_BUFFER will be returned β like, she's telling you to make room, respectfully π
π§ SINCE π§
3.6.3 β been iconic since way back π
π 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. (Slay, and also legally binding π )
π¦ 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, gnutls_pcert_li...mport_x509_file(3), and yeah the title got truncated in the header but we know her full name π mwah, go deinit your pcerts π«Ά
π¦ 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