GNUTLS_PKCS11_OBJ_GET_PK_ALGORITHM(3)
π gnutls_pkcs11_obj_get_pk_algorithm(3) π
okay bestie, sit down, we're reading a gnutls manpage together and honestly? it's giving "small function, big feelings". this is part of the gnutls manual, and it's about peeking at a PKCS#11 object and finding out what kind of key it's hiding. π
β¨ NAME β¨
gnutls_pkcs11_obj_get_pk_algorithm β an API function, no cap π«Ά
πΈ SYNOPSIS πΈ
#include <gnutls/pkcs11.h>
int gnutls_pkcs11_obj_get_pk_algorithm(gnutls_pkcs11_obj_t obj, unsigned
int * bits);
π¦ ARGUMENTS π¦
gnutls_pkcs11_obj_t objβ the pkcs11 object itself. the main character of this whole story πunsigned int * bitsβ this little pointer is gonna hold stuff for you. specifically: the rsa/dsa bit count, or the ecc curve. so here's the tea β you hand this function a pkcs11 object that already hasprivkey_typeinitialized, and on success it tells you the algorithm type. and if the algo type isGNUTLS_PK_RSAorGNUTLS_PK_DSA, it stores the number of bits in there. but if the algo type isGNUTLS_PK_ECDSA, it stores the curve instead. same pointer, different vibes, iykyk. π
β DESCRIPTION β
so like... the return value needs to be checked, okay? you have to check it, because only then do you know whether bits is representing the ecc curve or the number of bits. one pointer, two possible meanings, and it's on you to figure out which one you got. no shortcuts, bestie. π₯
π RETURNS π
the private key algorithm associated with the object on success β¨ β or an error code if it didn't work out. either way, check it. π
π SINCE π
3.8.13 β she's new-ish, she's fresh, she's here. π
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the devs:
- Report bugs to <bugs@gnutls.org>.
- 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. (yes, that's the whole thing, verbatim, go wild, just keep the notice π)
π SEE ALSO π
the full documentation for gnutls is maintained as a Texinfo manual. so if the /usr/share/doc/gnutls/ directory does not contain the HTML form, just go visit:
https://www.gnutls.org/manual/
and that's the whole page, bestie!! go forth, check your return values, and slay π β¨
mwah π β this was gnutls version 3.8.13, signing off π«Ά
π¦ 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