gnutls_privkey_sign_hash2(3)
β¨ gnutls_privkey_sign_hash2(3) β¨
okay bestie, gather round, because we're doing a gnutls manpage and this one is a certified banger. it lives in the gnutls manual (section 3, the library-functions girlies π
), and it's literally the glow-up version of its older sibling. let's get into it π«Ά
πΈ NAME πΈ
gnutls_privkey_sign_hash2 β API function
π SYNOPSIS π
#include <gnutls/abstract.h>
int gnutls_privkey_sign_hash2(gnutls_privkey_t signer,
gnutls_sign_algorithm_t algo, unsigned int flags, const gnutls_datum_t *
hash_data, gnutls_datum_t * signature);
π¦ ARGUMENTS π¦
gnutls_privkey_t signerβ this is the signer's key, like, the whole point of the operation. it holds the key that's doing the signing πgnutls_sign_algorithm_t algoβ the signature algorithm you're using, your moment to pick the vibe β¨unsigned int flagsβ zero, or one of thegnutls_privkey_flags_tvalues. zero or one, bestie, not a whole collection, we're not doing a haul here πconst gnutls_datum_t * hash_dataβ holds the data to be signed. yes it's already hashed, that's the whole thing, the name is not lying to you πgnutls_datum_t * signatureβ this is where the newly allocated signature goes. freshly allocated, just for you, iconic π
π DESCRIPTION π
so this function will sign the given hashed data using the specified signature algorithm. simple. elegant. main character energy β¨
but here's the tea: this function is an enhancement of gnutls_privkey_sign_hash(), because it lets you utilize an alternative signature algorithm where possible β like, for example, using an RSA key with RSA-PSS. it's giving glow-up. it's giving range π₯
the flags may be GNUTLS_PRIVKEY_SIGN_FLAG_TLS1_RSA. in that case, this function will ignore hash_algo and perform a raw PKCS1 signature. note that this flag is supported since 3.6.9. not me checking version numbers like they're release dates π
also note β and this is important, so listen up β not all algorithms support signing already hashed data. when you're signing with Ed25519, you should use gnutls_privkey_sign_data2() instead. that's the move. don't fight it, just switch functions π
β RETURNS β
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value, which is the library's way of saying "no π". check it, always check it, bestie π«Ά
π SINCE π
3.6.0 β she's been around, she's seasoned, she's got history π
π REPORTING BUGS π
found a bug? don't suffer in silence, report it:
- 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. slay, and also, legally binding π«Ά
π 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/
π ok that's the whole page, no cap, every option and every warning accounted for. go forth and sign responsibly.
and that's a wrap on this little page from the gnutls manual, version 3.8.13 β gnutls_privkey_sign_hash2(3), periodt π
β¨
π¦ 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