GNUTLS_PUBKEY_GET_PREFERRED_HASH_ALGORITHM(3)
β¨ NAME β¨
gnutls_pubkey_get_preferred_hash_algorithm β bestie, this is the lil gnutls function that tells you which hash algorithm your pubkey is literally begging to be signed with π
(It lives in the gnutls manual, section 3, and if you're lost already, don't worry, we got you π«Ά)
πΈ SYNOPSIS πΈ
#include <gnutls/abstract.h>
int gnutls_pubkey_get_preferred_hash_algorithm(gnutls_pubkey_t key,
gnutls_digest_algorithm_t * hash, unsigned int * mand);
π ARGUMENTS π
gnutls_pubkey_t keyβ holds the certificate. this is your main character, the key we're asking about πgnutls_digest_algorithm_t * hashβ the result of the call with the hash algorithm used for signature. she's the output bestie, the whole point of the function β¨unsigned int * mandβ if non zero it means that the algorithm MUST use this hash. May beNULL. like if this comes back non-zero, no takebacks, no negotiating, you're using that hash periodt π€
π DESCRIPTION π
okay so. this function will read the certificate and return the appropriate digest algorithm to use for signing with this certificate. some certificates (i.e. DSA might not be able to sign without the preferred algorithm) β like they're just built different and can't freestyle it π
to get the signature algorithm instead of just the hash, use gnutls_pk_to_sign() with the algorithm of the certificate/key and the provided hash. iykyk, one layer deeper π
β RETURNS β
the 0 if the hash algorithm is found. a negative error code is returned on error. so like, zero = slay, negative = not slay, that's the whole vibe check π¦
π§ SINCE π§
2.12.0 β she's been iconic since way back, no cap π
πΈ REPORTING BUGS πΈ
found a bug? not the cute kind? report it, bestie:
- 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. fr fr, that's the license, respect it π«Ά
π₯ 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/
okay that's the whole page bestie, go forth and hash responsibly πβ¨
mwah π β this was the gnutls manual page for gnutls_pubkey_g..._hash_algorithm(3), from gnutls 3.8.13. thanks for reading, you ate that ππ
π¦ 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