gnutls_pkcs11_token_get_ptr(3)

πŸ’– NAME πŸ’–

gnutls_pkcs11_token_get_ptr β€” ok bestie, this is an API function from the gnutls manual and it's about grabbing the raw function pointer for a PKCS#11 token, no cap πŸŽ€


✨ SYNOPSIS ✨

#include <gnutls/pkcs11.h>

int gnutls_pkcs11_token_get_ptr(const char * url, void ** ptr, unsigned
long * slot_id, unsigned int flags);

like. that's the whole vibe. one header, one function, four args, periodt πŸ’…


🫢 ARGUMENTS 🫢

  • const char * url β€” this one should contain a PKCS11 URL that identifies a token 🌸 so like, you're telling it which token you want, iykyk
  • void ** ptr β€” on the way out this will contain the CK_FUNCTION_LIST_PTR pointer ⭐ that's the actual good stuff right there
  • unsigned long * slot_id β€” this will contain the slot_id πŸ¦‹ and heads up: it may be NULL, so it's optional, she's flexible πŸ’œ
  • unsigned int flags β€” should be zero πŸ™ˆ that's it. zero. nothing else. don't be creative with it bestie

🧚 DESCRIPTION 🧚

Okay so here's the tea β˜• β€” this function will return the function pointer of the specified token by the URL. You hand it a URL, it hands you back the function pointer for that token, and you go off and do your little PKCS#11 things with it. Iconic behaviour honestly πŸ‘‘

BUT. and this is the important part, the part where you listen to me β€” the returned pointers are valid until gnutls is deinitialized, c.f. _global_deinit(). So the moment gnutls gets deinitialized, those pointers are gone gone, they are not yours anymore, do not touch them, do not keep them in a little jar 😭 it's giving expired milk. use them before then or perish πŸ’€


πŸ”₯ RETURNS πŸ”₯

  • GNUTLS_E_SUCCESS (0) on success πŸŽ‰ she ate
  • or a negative error code on error πŸ˜” and if that happens, bestie, check your URL, it's probably not the vibe

🌈 SINCE 🌈

3.6.3 β€” she's been here since 3.6.3, a whole elder, respect her πŸ’…βœ¨


πŸ› REPORTING BUGS πŸ›

Found a bug? Report bugs to <bugs@gnutls.org> πŸ“§

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

They want to hear about it fr fr, don't just suffer in silence 🫢


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. so like, go off, copy it, 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, that's the plug. go read it 🌸


k bye bestie, this page is from gnutls 3.8.13 and it's the gnutls_pkcs11_token_get_ptr(3) page, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from