gnutls_privkey_import_ext2(3)

πŸ’– gnutls_privkey_import_ext2(3) πŸ’–

okay bestie, so this one lives in the gnutls manual, and it's literally the glow-up page for gnutls_privkey_import_ext2. it's an API function, she's iconic, she lets you be the main character behind the key. let's get into it 🫢


✨ NAME ✨

gnutls_privkey_import_ext2 β€” API function

no cap, that's the whole name. short, sweet, slays.


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_privkey_import_ext2(gnutls_privkey_t pkey,
gnutls_pk_algorithm_t pk, void * userdata, gnutls_privkey_sign_func
sign_fn, gnutls_privkey_decrypt_func decrypt_fn,
gnutls_privkey_deinit_func deinit_fn, unsigned int flags);

look at that signature. seven arguments. she's high maintenance but she's worth it πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_privkey_t pkey β€” the private key itself, the moment, the whole point πŸ’–
  • gnutls_pk_algorithm_t pk β€” the public key algorithm. yes babe, tell us which flavor πŸ¦‹
  • void * userdata β€” your private data, and it gets handed straight to the callbacks. it's giving "your stuff, your rules" ✨
  • gnutls_privkey_sign_func sign_fn β€” the callback for signature operations. sign, queen πŸ‘‘
  • gnutls_privkey_decrypt_func decrypt_fn β€” the callback for decryption operations. unlock that tea πŸ”“
  • gnutls_privkey_deinit_func deinit_fn β€” a deinitialization function, aka the cleanup bestie 🧹
  • unsigned int flags β€” flags for the import. little toggles, big energy ⭐

🌈 DESCRIPTION 🌈

okay so this function will associate the given callbacks with the gnutls_privkey_t type. and here's the vibe check: at least one of the two callbacks must be non-null. you can't just show up with nothing, bestie 😭

and if a deinitialization function is provided, then flags is assumed to contain GNUTLS_PRIVKEY_IMPORT_AUTO_RELEASE. the way that just… happens automatically, no questions asked πŸ™ˆ

lowkey important: note that the signing function is supposed to "raw" sign data, i.e., without any hashing or preprocessing. so like, no extra steps, no sprinkles, just raw. in case of RSA the DigestInfo will be provided, and the signing function is expected to do the PKCS 1 1.5 padding and the exponentiation. yes, that's on you, diva πŸ’…

See also gnutls_privkey_import_ext3() β€” she's the sequel, the ext3 era 🌟


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so like, zero is the slay, negative is the 😭


πŸ¦‹ SINCE πŸ¦‹

3.1 β€” she's been here since 3.1, an OG fr fr


πŸ’€ REPORTING BUGS πŸ’€

Report bugs to <bugs@gnutls.org>.

Home page: https://www.gnutls.org

(if you find a bug, tell them! don't just suffer in silence bestie 🫢)


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.

(translation: go off, share the file, just keep the receipts πŸ’–)


🌸 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/

like, if it's not in your /usr/share/doc/gnutls/ folder, the link has you covered πŸ”₯


and that's the whole page, bestie!! every flag, every callback, every caveat, all preserved, just with the correct amount of ✨drama✨ πŸŽ€

mwah πŸ’‹ β€” this was the gnutls manual, version 3.8.13, page gnutls_privkey_import_ext2(3). go raw-sign something iconic πŸ‘‘βœ¨

πŸ“¦ where this page comes from