gnutls_privkey_import_ext3(3)
π gnutls_privkey_import_ext3(3) π
okay bestie, this one lives in the gnutls manual (the whole library's docs, yk) and it's literally the glow-up that lets you be the private key. no cap.
β¨ NAME β¨
gnutls_privkey_import_ext3 β API function π«Ά
β¨ SYNOPSIS β¨
#include <gnutls/abstract.h>
int gnutls_privkey_import_ext3(gnutls_privkey_t pkey, void * userdata,
gnutls_privkey_sign_func sign_fn, gnutls_privkey_decrypt_func
decrypt_fn, gnutls_privkey_deinit_func deinit_fn,
gnutls_privkey_info_func info_fn, unsigned int flags);
β¨ ARGUMENTS β¨
gnutls_privkey_t pkeyβ the private key itself, the main character πvoid * userdataβ private data that gets handed over to the callbacks, like a lil snack you pack for themgnutls_privkey_sign_func sign_fnβ the callback that handles signature operations βοΈgnutls_privkey_decrypt_func decrypt_fnβ the callback that handles decryption operations πgnutls_privkey_deinit_func deinit_fnβ a deinitialization function, aka the goodbye-hug functiongnutls_privkey_info_func info_fnβ returns info about the public key algorithm, and it should not beNULLπ«unsigned int flagsβ flags for the import π©
β¨ DESCRIPTION β¨
So basically this function associates the callbacks you give it with the gnutls_privkey_t type. β¨
At least one of the two callbacks (sign_fn or decrypt_fn) must be non-null. and if you hand over a deinitialization function, then flags is assumed to contain GNUTLS_PRIVKEY_IMPORT_AUTO_RELEASE. that's just how it is, periodt.
Heads up bestie: the signing function is supposed to "raw" sign data β like, without any hashing or preprocessing. none. zero. In the case of RSA theDigestInfowill be provided, and your signing function is expected to do thePKCS 1 1.5padding and the exponentiation. yes, you. it's giving DIY π
The info_fn must provide information on the algorithms supported by this private key, and it should support the flags GNUTLS_PRIVKEY_INFO_PK_ALGO and GNUTLS_PRIVKEY_INFO_SIGN_ALGO. It must return -1 on unknown flags. no guessing, no improvising π₯
β¨ RETURNS β¨
On success, GNUTLS_E_SUCCESS (0) is returned π otherwise you get a negative error value. it's giving "we're so back" vs "it's over". π
β¨ SINCE β¨
3.4.0 β an icon, honestly, a legend, been here forever π
β¨ REPORTING BUGS β¨
found a bug? spill 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 generous, we love to see it π
β¨ 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!! this was gnutls version 3.8.13, page gnutls_privkey_import_ext3(3), mwah π go raw-sign something iconic β¨π¦π
π¦ 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