gnutls_privkey_import_ext(3)

πŸ’– gnutls_privkey_import_ext(3) πŸ’–

okay bestie, welcome to the gnutls manual, we're doing the whole thing, sit down, hydrate 🫢


✨ NAME ✨

gnutls_privkey_import_ext β€” literally an API function, that's it, that's the name πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/abstract.h>

int gnutls_privkey_import_ext(gnutls_privkey_t pkey,
gnutls_pk_algorithm_t pk, void * userdata, gnutls_privkey_sign_func
sign_func, gnutls_privkey_decrypt_func decrypt_func, unsigned int
flags);

✨ ARGUMENTS ✨

  • gnutls_privkey_t pkey β€” the private key in question, your main character πŸŽ€
  • gnutls_pk_algorithm_t pk β€” the public key algorithm, so like, what flavor of crypto are we on
  • void * userdata β€” private data that gets handed off to the callbacks, like a lil care package πŸ“
  • gnutls_privkey_sign_func sign_func β€” the callback for signature operations ✍️
  • gnutls_privkey_decrypt_func decrypt_func β€” the callback for decryption operations πŸ”“
  • unsigned int flags β€” flags for the import, the little toggles, the vibes

✨ DESCRIPTION ✨

so this function associates the callbacks you gave it with the gnutls_privkey_t type. at least one of the two callbacks must be non-null β€” that's not a suggestion, that's the rule, no cap 🫢

heads up bestie: the signing function is supposed to "raw" sign data. like, without any hashing or preprocessing, none, zero, nada. in the case of RSA the DigestInfo will be provided to you, and your signing function is expected to do the PKCS 1 1.5 padding and the exponentiation. it's giving "you're on your own, girlie" but in a fun way πŸ’€

also go peep gnutls_privkey_import_ext3() if you wanna see the sibling ✨


✨ RETURNS ✨

on success, GNUTLS_E_SUCCESS (that's 0) is returned πŸŽ‰ otherwise you get a negative error value, which is the universe's way of saying "not today" 😭


✨ SINCE ✨

3.0 β€” she's been iconic for a minute πŸ‘‘


✨ REPORTING BUGS ✨

found a bug? don't suffer in silence, tell the girlies:

report bugs to <bugs@gnutls.org>. home page: https://www.gnutls.org


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. slay, and also legally binding πŸ’…


✨ 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, you ate that 🧚 this was gnutls version 3.8.13, page gnutls_privkey_import_ext(3), mwah, go forth and raw-sign responsibly πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from