GNUTLS_X509_PRIVKEY_IMPORT_OPENSSL(3)
π NAME π
gnutls_x509_privkey_import_openssl β it's an API function, bestie, and it lives in the gnutls manual (section 3, the library-calls one, iykyk).
β¨ SYNOPSIS β¨
#include <gnutls/x509.h>
int gnutls_x509_privkey_import_openssl(gnutls_x509_privkey_t key, const
gnutls_datum_t * data, const char * password);
π ARGUMENTS π
gnutls_x509_privkey_t keyβ okay so this is where the parsed key goes. The data lives here after we're done with it, it's giving β¨output slotβ¨.const gnutls_datum_t * dataβ the actual key, and it can be DER or PEM encoded. Either one, we're not picky π«Άconst char * passwordβ the password that decrypts the key, but only if it's encrypted. No encryption, no password needed, no stress π
πΈ DESCRIPTION πΈ
Okay so here's the vibe: this function takes your PEM encrypted key and converts it into the native gnutls_x509_privkey_t format. The result gets stored in key, like a lil gift π
The password has to be in ASCII. And listen β if you don't hand over a password, or the one you give is straight-up wrong, you're getting GNUTLS_E_DECRYPTION_FAILED back. Not me, that's just the rules π
If the Certificate is PEM encoded (yes, the manpage says "Certificate", we're quoting it fr fr), it needs a header of "PRIVATE KEY" and it also needs the "DEK-Info" header. Both. No skipping π¨
β RETURNS β
Slay moment: on success you get GNUTLS_E_SUCCESS (0). Anything else? That's a negative error value, so basically the function is giving you the ick in integer form π
π REPORTING BUGS π
Found a bug? Don't be shy, tell the devs:
- 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. (Read it, respect it, it's iconic π)
π¦ 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/
k that's the whole page bestie, go import your keys and be the main character π
signing off from the gnutls manual β source/version gnutls 3.8.13, dated right there with the rest of the gnutls_x509_pri..._import_openssl(3) page πβ¨ bye!!
π¦ 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