GNUTLS_X509_PRIVKEY_SET_PIN_FUNCTION(3)

✨ gnutls_x509_privkey_set_pin_function(3) ✨

okay bestie, welcome to the gnutls manual, and today's episode is about one very specific little function. it's an API function, it lives in gnutls, and it's about to be your new bestie if you've ever needed to hand a PIN over to something that really wants a PIN. πŸ’…


🌸 NAME 🌸

gnutls_x509_privkey_set_pin_function β€” an API function, no cap


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/x509.h>

void gnutls_x509_privkey_set_pin_function(gnutls_x509_privkey_t privkey,
gnutls_pin_callback_t fn, void * userdata);

πŸ’– ARGUMENTS πŸ’–

  • gnutls_x509_privkey_t privkey β€” the certificate structure 🫢 like, this is the thing you're attaching your callback to.
  • gnutls_pin_callback_t fn β€” the callback ✨ the actual function that's gonna get called.
  • void * userdata β€” data associated with the callback 🌈 it rides along with fn, so whatever you need to hand it, this is where it goes.

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: this function will set a callback function to be used when it is required to access a protected object. that's the whole vibe. πŸ”

and the important part β€” this function overrides the global function set using gnutls_pkcs11_set_pin_function(). so if you've already set a global one and then you set this one, this one wins. local beats global, main character energy, periodt. πŸ‘‘

also note, and this is key: this callback is used when decrypting a key. πŸ”‘ that's its moment, that's its whole thing.

⭐ SINCE ⭐

3.4.0 β€” she's been around for a while, iconic behavior.


😭 REPORTING BUGS 😭

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


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. πŸ’œ


🌈 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, and honestly? she ate. go set that callback. πŸ«ΆπŸ’…

πŸ“¦ where this page comes from