gnutls_x509_privkey_import(3)
π NAME π
gnutls_x509_privkey_import β okay bestie, this is the API function that takes your DER-or-PEM private key and makes it β¨nativeβ¨
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_privkey_import(gnutls_x509_privkey_t key, const
gnutls_datum_t * data, gnutls_x509_crt_fmt_t format);
π ARGUMENTS π
gnutls_x509_privkey_t keyβ the place where the parsed key gets stored, like the little β¨slotβ¨ where your data is gonna liveconst gnutls_datum_t * dataβ the DER or PEM encoded certificate (yes, fr fr, that's literally what the original says, we are not editing the lore)gnutls_x509_crt_fmt_t formatβ pick your fighter: one ofDERorPEM
π¦ DESCRIPTION π¦
So the way this works: you hand it a DER or PEM encoded key, and this function converts it into the native gnutls_x509_privkey_t format. The glow-up output gets stored in key. π
If your key is PEM encoded, it should have a header containing "PRIVATE KEY". And listen β no cap β this function falls back to PKCS 8 decoding without password if the default format fails to import. Iconic behaviour honestly. π
β RETURNS β
On success you get GNUTLS_E_SUCCESS (0) back, and it's giving main character energy. Otherwise you get a negative error value, which is your cue to go fix something. π
π REPORTING BUGS π
Found a bug? Not you being the detective π β report it to <bugs@gnutls.org>.
Home page is right here: 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 go forth and share, legally, periodt. π«Ά
π 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_x509_privkey_import, manual gnutls, version 3.8.13. Slay, go import some keys. πβ¨π
π¦ 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