gnutls_pkcs11_token_get_info(3)

πŸ’… gnutls_pkcs11_token_get_info β€” the manual, but make it make sense

okay bestie, so this one lives in the gnutls manual (you know, the TLS library that's been holding the internet together since forever) and it's all about peeking at your PKCS 11 token and asking it politely "hey, what are you, actually?" πŸŽ€


✨ NAME ✨

gnutls_pkcs11_token_get_info β€” an API function, and yes it does exactly what the name says πŸ’–


🌸 SYNOPSIS 🌸

#include <gnutls/pkcs11.h>

int gnutls_pkcs11_token_get_info(const char * url,
gnutls_pkcs11_token_info_t ttype, void * output, size_t * output_size);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • const char * url β€” bestie this should contain a PKCS 11 URL. that's literally it, that's the whole vibe.
  • gnutls_pkcs11_token_info_t ttype β€” says what kind of info you're asking for. like, which tea are we spilling today πŸ‘€
  • void * output β€” the spot where the answer gets stored. bring your own buffer, we don't provide one.
  • size_t * output_size β€” you put the max size of your output buffer in here, and it gets overwritten with the actual size. so it's an in-and-out situation, lowkey iconic.

🌈 DESCRIPTION 🌈

This function returns info about the PKCS 11 token β€” the label, the id, etc. just, like, the token's whole identity ✨

When the output is text, a null terminated string gets written into output, and its string length goes into output_size (and no, the null terminator is not counted, we're not counting that bestie).

But here's the moment where it gets real: if your buffer is too small, output_size will contain the expected buffer size (with the null terminator included, for text) and the function returns GNUTLS_E_SHORT_MEMORY_BUFFER. so it's not a crash, it's a hint. it's giving "try again with more room" 🫢


πŸ”₯ RETURNS πŸ”₯

GNUTLS_E_SUCCESS (which is 0, the number of good vibes) on success, or a negative error code on error. negative = bad, periodt πŸ’€


⭐ SINCE ⭐

2.12.0 β€” ancient, but still eating πŸ’…


😭 REPORTING BUGS 😭

Found a bug? spill it to <bugs@gnutls.org>. no gatekeeping.

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. (fr fr, just keep the notice and you're good 🌸)


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


go read the actual docs too bestie, this page is the vibe but that one's the whole lore πŸ“š

and that's the whole page, no cap. this was gnutls 3.8.13, and gnutls_pkcs11_token_get_info(3) is out here living its best life on your system πŸŽ€πŸ’– stay curious, check your buffer sizes, and slay ✨

πŸ“¦ where this page comes from