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 the gnutls_privkey_flags_t values. 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 with gnutls_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:

they wanna hear from you, no cap 🫢


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