gnutls_x509_privkey_import2(3)
π gnutls_x509_privkey_import2(3) π
okay bestie, sit down, we're reading the gnutls manual together and honestly? this one is a bop. it's from the gnutls manual pages, section 3, and it's about dragging a private key into the house and making it GnuTLS-native. let's go π«Ά
β¨ NAME β¨
gnutls_x509_privkey_import2 β it's an API function, bestie. that's it, that's the name, no notes π
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_privkey_import2(gnutls_x509_privkey_t key, const
gnutls_datum_t * data, gnutls_x509_crt_fmt_t format, const char *
password, unsigned int flags);
look at her. five arguments, one int return, zero drama. iconic behavior π
π ARGUMENTS π
gnutls_x509_privkey_t keyβ this is where the parsed key is gonna live. the data goes here. the vibe check destination, if you will β¨const gnutls_datum_t * dataβ the actual key, encoded as DER or PEM. she's the moment.gnutls_x509_crt_fmt_t formatβ pick your fighter: one ofDERorPEMπ¦const char * passwordβ a password. optional, so like, no pressure, but also don't forget it πunsigned int flagsβ an ORed sequence ofgnutls_pkcs_encrypt_flags_t. yes, ORed. stack them like bracelets π
π DESCRIPTION π
so what does she DO. this function imports the given DER or PEM encoded key and converts it into the native gnutls_x509_privkey_t format β no matter what format it came in as. and the input format? auto-detected. she just knows. main character energy fr fr π
the supported formats are:
- basic unencrypted key
- PKCS8
- PKCS12
- the openssl format
now. listen. if the key you handed over is encrypted but you gave no password? then GNUTLS_E_DECRYPTION_FAILED comes back at you. that's the error, that's the tea, that's what you get π«
and since GnuTLS 3.4.0, this function will utilize the PIN callbacks if any. so if you set those up, she'll use them. slay π
β RETURNS β
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value. that's the whole vibe check: zero is good, negative is not π₯
π REPORTING BUGS π
found a bug? don't suffer in silence, bestie. report bugs to <bugs@gnutls.org>.
home page: https://www.gnutls.org β go, be nosy π
π 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, 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/
iykyk π
okay that's the whole page, you ate it, you understood it, I'm so proud of you π₯Ή this was the gnutls manual, version 3.8.13, page gnutls_x509_privkey_import2(3). go import some keys responsibly, bestie πππ¦πΈβ¨
π¦ 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