gnutls_privkey_import_tpm_url(3)

✨ gnutls_privkey_import_tpm_url ✨

okay bestie, so this one lives in the gnutls manual (that's the gnutls 3.8.13 manual, to be exact πŸ’–) and it's literally an API function. Yes, lowercase "API function", that's the vibe. It's the one you call when you've got a private key chillin' inside a TPM and you want it to live inside gnutls' fancy abstract private-key situation. πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_privkey_import_tpm_url(gnutls_privkey_t pkey, const char *
url, const char * srk_password, const char * key_password, unsigned int
flags);

like. five things. one return value. iconic behavior, no notes. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_privkey_t pkey β€” the private key itself, the main character, the one we're importing into πŸ‘‘
  • const char * url β€” the URL of the TPM key you wanna import, so it knows where to go fetch the goods ✨
  • const char * srk_password β€” the password for the SRK key. it's optional 🫢
  • const char * key_password β€” a password for the key. also optional, also slay πŸ™ˆ
  • unsigned int flags β€” one of the GNUTLS_PRIVKEY_* flags. pick your fighter πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

so basically? this function will import the given private key into the abstract gnutls_privkey_t type. that's it. that's the whole job. and it does it well. πŸ’…

okay now the important part, listen up bestie, no cap πŸ‘€

unless GNUTLS_PRIVKEY_DISABLE_CALLBACKS is specified, if you give incorrect passwords (or NULL passwords, which like… same energy tbh 😭) then the PKCS11 callback functions will be used to go obtain the correct passwords for you. so it's giving helpful. it's giving resourceful. 🧚

but otherwise β€” if the callbacks aren't in play β€” here's how it goes down:

  • if the SRK password is wrong, you get GNUTLS_E_TPM_SRK_PASSWORD_ERROR back 🌸
  • if the key password is wrong, or you just didn't provide one at all, you get GNUTLS_E_TPM_KEY_PASSWORD_ERROR back πŸ¦‹

so like, the errors are specific. they're not vague. they will tell you exactly which password you fumbled. we love an honest king. ⭐


🌈 RETURNS 🌈

on success, GNUTLS_E_SUCCESS β€” which is 0, bestie, a big fat zero, the good zero β€” is returned. πŸ’–

otherwise you get a negative error value. so like, if it's negative, that's your sign. negative = not it πŸ’€


πŸŽ€ SINCE πŸŽ€

3.1.0 β€” so this has been around for a while, it's practically a legacy icon at this point πŸ‘‘


🫢 REPORTING BUGS 🫢

found a bug? spill. report bugs to <bugs@gnutls.org> πŸ“§

home page, for when you're feeling nosy: 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. (yes, that includes you, go forth and redistribute responsibly 🫑)


⭐ 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, just go read it. it's there. it's waiting. πŸ“š


and that's the whole page, bestie πŸŽ€ this was gnutls_privkey_import_tpm_url(3) from the gnutls manual, version 3.8.13, and if you made it this far you deserve a little treat. go import a key. slay. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from