gnutls_x509_privkey_sign_hash(3)

πŸ’– gnutls_x509_privkey_sign_hash β€” the gnutls manual, bestie edition πŸ’–

okay so this page lives in the gnutls manual (section 3, the library-call girlies ✨) and it's literally called gnutls_x509_privkey_sign_hash β€” described, in the official words, as an API function. iconic of it.


🌸 NAME 🌸

gnutls_x509_privkey_sign_hash β€” an API function 🫢


✨ SYNOPSIS ✨

#include <gnutls/compat.h>

int gnutls_x509_privkey_sign_hash(gnutls_x509_privkey_t key, const
       gnutls_datum_t * hash, gnutls_datum_t * signature);

like, that's the whole vibe right there πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_privkey_t key β€” a key. that's it. that's the description. a key. πŸ”‘
  • const gnutls_datum_t * hash β€” holds the data to be signed πŸ“
  • gnutls_datum_t * signature β€” will contain the newly allocated signature ✨ (yes bestie, newly allocated, someone's gotta free that)

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function signs the hash you hand it, using the private key. that's the tea. 🍡

BUT β€” and this is the important part β€” do not use this function directly unless you genuinely know what it is. like, fr fr. typical signing requires the data to be hashed and stored in special formats (for example, BER Digest-Info for RSA). so if you're out here raw-dogging this call without that, that's on you 😭

this API is provided only for backwards compatibility, and because of that it's restricted to RSA, DSA and ECDSA key types. periodt.

for other key types, please use gnutls_privkey_sign_hash() and gnutls_privkey_sign_data() instead. those are the main character functions, this one is the nostalgic cameo πŸ‘‘


πŸ’« RETURNS πŸ’«

on success, GNUTLS_E_SUCCESS (0) is returned πŸŽ‰ otherwise you get a negative error value (boooo πŸ…).

Deprecated in: 2.12.0 β€” yeah she's retired but still showing up to the party πŸ’€

πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? spill it to <bugs@gnutls.org> πŸ“§

home page: https://www.gnutls.org


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, take it, share it, just keep the receipts πŸ§ΎπŸ’–


🌈 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/


and that's the whole page bestie, no cap. this was gnutls_x509_privkey_sign_hash(3), served to you from the gnutls 3.8.13 era of the manual β€” go forth, sign responsibly, and remember: don't call the deprecated one unless you know what it is πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from