GNUTLS_PKCS11_TOKEN_GET_MECHANISM(3)
π gnutls_pkcs11_token_get_mechanism(3) π
okay bestie, so this one lives in the gnutls manual, and it's a lil API function that goes digging through your PKCS 11 token to find out what crypto mechanisms it can actually do. iykyk π«Ά
β¨ NAME β¨
gnutls_pkcs11_token_get_mechanism β API function
πΈ SYNOPSIS πΈ
#include <gnutls/pkcs11.h>
int gnutls_pkcs11_token_get_mechanism(const char * url, unsigned int
idx, unsigned long * mechanism);
π ARGUMENTS π
const char * urlβ this should contain a PKCS 11 URL. that's it, that's the whole vibe πunsigned int idxβ the index of the mechanism, like which one in the list you're asking aboutunsigned long * mechanismβ the PKCS 11 mechanism ID lands here π«Ά
π¦ DESCRIPTION π¦
so like, this function will return the names of the supported mechanisms by the token. no cap.
here's the move: you call it with an increasing index until it returns GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE. that's how you know you've hit the end of the list, bestie β it's giving "no more for you, go home" π
so you just keep bumping that index up, one at a time, collecting mechanisms, and when you get GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE back? you're done. periodt. π
π RETURNS π
GNUTLS_E_SUCCESS (0) on success β slay β¨ β or a negative error code on error. (yes the negative ones are the sad ones, we don't love those)
β SINCE β
2.12.0 β an elder, a legend, iconic since way back π«
π REPORTING BUGS π
found a bug? not me being the messenger but β report bugs to <bugs@gnutls.org>. they wanna hear it, fr fr.
Home page: https://www.gnutls.org
π COPYRIGHT π
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/
mwah π that's the whole page. this is gnutls version 3.8.13, page gnutls_pkcs11_token_get_mechanism(3), and that's a wrap bestie β go enumerate some mechanisms, you absolute main character π§π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms