GNUTLS_CERTIFICATE_SET_X509_SIMPLE_PKCS12_FILE(3)
β¨ NAME β¨
gnutls_certificate_set_x509_simple_pkcs12_file β bestie, it's an API function π (from the gnutls manual, if you were wondering who invited her)
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
int
gnutls_certificate_set_x509_simple_pkcs12_file(gnutls_certificate_credentials_t
res, const char * pkcs12file, gnutls_x509_crt_fmt_t type, const char *
password);
π ARGUMENTS π
gnutls_certificate_credentials_t resβ okay so this is agnutls_certificate_credentials_ttype. she's the main character, everything gets loaded into her πconst char * pkcs12fileβ the filename of the file containing the PKCS12 blob. yes queen, that's the one π«Άgnutls_x509_crt_fmt_t typeβ this is PEM or DER, specifying the format of thepkcs12file. pick one, she can't read your mind πconst char * passwordβ optional password used to decrypt the PKCS12 file, the bags and the keys π
π DESCRIPTION π
So basically, this function sets a certificate/private key pair and/or a CRL inside the gnutls_certificate_credentials_t type. And the way that you can call this function more than once?? iconic β like if multiple keys/certificates exist for the server, she's fine with it, she can hold several, no cap π
PKCS12 files with a MAC, encrypted bags and PKCS 8 private keys are supported. slay. However (and this is the important part, bestie, don't skip it π), only password based security is supported, and it's the same password for all operations β one password, no pick-and-choose, periodt.
PKCS12 files can contain many keys and/or certificates, and this function will try to auto-detect, based on the key ID, which certificate and key pair to use. And if the PKCS12 file contains the issuer of the selected certificate, it gets appended to the certificate to form a chain. cute little family reunion fr fr π
If more than one private key is stored in the PKCS12 file, then only one key will be read β and honestly it is undefined which one. so like, don't count on it, that's giving chaos π
It is believed that the limitations of this function are acceptable for most usage, and that any more flexibility would introduce complexity that would make it harder to use this functionality at all. so like, she's keeping it simple on purpose, it's a design choice not a bug, iykyk β¨
Note that this function by default returns zero on success and a negative value on error. Since 3.5.6, when the flag GNUTLS_CERTIFICATE_API_V2 is set using gnutls_certificate_set_flags() it returns an index (greater or equal to zero). That index can be used by other functions to refer to the added key-pair. like a little name tag for your key-pair π·οΈ
β RETURNS β
On success this function returns zero, and otherwise a negative value on error (see above for how to modify that behavior π).
π¦ REPORTING BUGS π¦
Found something cursed? 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. so like, go off, 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/
and that's the whole page, bestie β no notes, ate and left no crumbs πβ¨
this was brought to you by the gnutls manual, version 3.8.13 β mwah, take care of your certs π
π
π¦ 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