gnutls_x509_privkey_import_pkcs8(3)
β¨ gnutls_x509_privkey_import_pkcs8 β¨
okay bestie, welcome to the gnutls manual, page gnutls_x509_privkey_import_pkcs8(3) β yes it's a whole mouthful, yes it's an API function, and yes we're gonna get you fluent in it π
πΈ NAME πΈ
gnutls_x509_privkey_import_pkcs8 β it's an API function, girlie. that's the whole vibe of the name. π
π¦ SYNOPSIS π¦
#include <gnutls/x509.h>
int gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey_t key, const
gnutls_datum_t * data, gnutls_x509_crt_fmt_t format, const char *
password, unsigned int flags);
look at that signature. iconic. no notes. β¨
π ARGUMENTS π
gnutls_x509_privkey_t keyβ this is where the parsed key is gonna live. it's the data to store the parsed key, basically the lil home you're giving your newly imported key πconst gnutls_datum_t * dataβ the actual key itself, DER or PEM encoded. the main character of the whole operation fr fr π₯gnutls_x509_crt_fmt_t formatβ pick your fighter: one of DER or PEM. that's it, those are the options πconst char * passwordβ the password to decrypt the key, but only if it's encrypted. no password needed if it's out here raw and unencrypted π«Άunsigned int flagsβ0if the key is encrypted, orGNUTLS_PKCS_PLAINif it's not encrypted. that's the whole assignment bestie, don't overthink it π
π DESCRIPTION π
so this function? it takes your DER or PEM encoded PKCS8 2.0 encrypted key and converts it into the native gnutls_x509_privkey_t format. glow-up complete β¨ the output lands in key. and good news: both RSA and DSA keys can be imported, and honestly flags can only be used to indicate an unencrypted key. that's its one job π
the password can be either ASCII or UTF-8 in the default PBES2 encryption schemas, or ASCII for the PKCS12 schemas. so like, mind your encoding, okay? π§
if the Certificate is PEM encoded it should have a header of "ENCRYPTED PRIVATE KEY", or "PRIVATE KEY". and listen β you only need to specify flags if the key is DER encoded, because in that case the encryption status cannot be auto-detected. DER is keeping secrets, lowkey rude of it π
β οΈ if theGNUTLS_PKCS_PLAINflag is specified and the supplied data are encrypted, thenGNUTLS_E_DECRYPTION_FAILEDgets returned. so don't lie to it about the encryption status, it WILL catch you π
π RETURNS π
on success, GNUTLS_E_SUCCESS (0) is returned β slay, we love a clean zero π otherwise you get a negative error value. not the vibe, but at least it's honest about it.
π REPORTING BUGS π
found a bug? don't be shy, 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. so go forth and share, bestie π«Ά
π₯ 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 page!! this was gnutls version 3.8.13, page gnutls_x509_privkey_import_pkcs8(3), brought to you by the gnutls manual itself. go import some keys, you absolute icon ππ
β¨
π¦ 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