gnutls_privkey_sign_data2(3)
β¨ gnutls_privkey_sign_data2 β¨
okay so bestie, welcome to the gnutls abstract-key corner of the manual π this one's a little API function called gnutls_privkey_sign_data2, and no cap it is SO much more chill than its name makes it sound. grab a strawberry π and let's get into it.
πΈ SYNOPSIS πΈ
#include <gnutls/abstract.h>
int gnutls_privkey_sign_data2(gnutls_privkey_t signer,
gnutls_sign_algorithm_t algo, unsigned int flags, const gnutls_datum_t *
data, gnutls_datum_t * signature);
like, yes, that's a whole lotta parameters, but they all make sense i promise π«Ά
π ARGUMENTS π
gnutls_privkey_t signerβ bestie this is literally just the key. the one holding all the power. main character energy honestly πgnutls_sign_algorithm_t algoβ the signature algorithm you wanna use. your pick, your vibe β¨unsigned int flagsβ zero, or literally one, of thegnutls_privkey_flags_tvalues. that's it. that's the whole range. not me being strict about it πconst gnutls_datum_t * dataβ the data that's getting signed. the little guy going under the pen ποΈgnutls_datum_t * signatureβ where the signature lands once we're done, and it'll be allocated withgnutls_malloc()so bestie, that memory is yours to free later, don't forget π
π DESCRIPTION π
so this function signs the data you hand it, using the signature algorithm you specified. simple as that π
but here's the slay: it's an enhancement of gnutls_privkey_sign_data(), because it lets you use an alternative signature algorithm where possible. the example the docs give is using an RSA key with RSA-PSS, which is genuinely such a glow-up π₯ so if you've been stuck on the original and wanted more flexibility β this is the one, fr fr.
β RETURNS β
when everything goes right, you get GNUTLS_E_SUCCESS (that's 0, the number of good vibes) back π
and if it doesn't? you get a negative error value. so like, if your return value is negative, that's the universe telling you something went wrong, bestie π
π¦ SINCE π¦
3.6.0 β she's been around a minute, she's established, she's iconic π§
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the people:
- Report bugs to <bugs@gnutls.org>
- Home page: https://www.gnutls.org
they wanna hear from you, no cap π«Ά
π 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. so like, go forth, share the love, just keep the receipt πΈ
π SEE ALSO π
the full documentation for gnutls is maintained as a Texinfo manual. and if the /usr/share/doc/gnutls/ directory does not contain the HTML form, then bestie you gotta go visit:
https://www.gnutls.org/manual/
it's giving required reading, iykyk π
okay that's the whole page, you ate that π
go sign some data, treat yourself, free your gnutls_malloc() buffers.
this has been your girl from gnutls version 3.8.13, bringing you gnutls_privkey_sign_data2(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