gnutls_pubkey_import_privkey(3)

πŸ’– gnutls_pubkey_import_privkey(3) πŸ’–

okay bestie, welcome to the gnutls manual, and today's main character is gnutls_pubkey_import_privkey β€” an API function, no cap. she's the one who takes a private key and goes "oh you also have a public key in there? let me grab that for you." 🫢


✨ SYNOPSIS ✨

#include <gnutls/abstract.h>

int gnutls_pubkey_import_privkey(gnutls_pubkey_t key, gnutls_privkey_t pkey,
                                 unsigned int usage, unsigned int flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_pubkey_t key β€” the public key. the destination, the moment, the glow-up recipient ✨
  • gnutls_privkey_t pkey β€” the private key. she's the source of truth here, the one we're extracting from πŸ’…
  • unsigned int usage β€” GNUTLS_KEY_* key usage flags. tell her what this key is for, she needs to know πŸ”₯
  • unsigned int flags β€” should be zero. literally zero. don't get creative with it πŸ™ˆ

🌸 DESCRIPTION 🌸

so the whole vibe is: imports the public key from a private. yes, from a private one. this function will import the given public key into the abstract gnutls_pubkey_t type β€” the public key equivalent of "not me pulling your whole personality out of your private key bestie" 😭

lowkey important: note that in certain keys this operation may not be possible, e.g., in other than RSA PKCS11 keys. so if it doesn't work for your key type, that's not you being bad at unix, that's just the deal fr fr πŸ’€

⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. negative means something went wrong, check your vibe check and try again 🌈


πŸ¦‹ SINCE πŸ¦‹

2.12.0 β€” she's been iconic for a minute, an OG queen πŸ‘‘


πŸ“ REPORTING BUGS πŸ“

found a bug? spill it to bugs@gnutls.org. they want to hear from you, bestie.

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, that's a generous license, respect 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. gnutls 3.8.13, manual page gnutls_pubkey_import_privkey(3) β€” go import some public keys, you absolute icon πŸ’–βœ¨

πŸ“¦ where this page comes from