gnutls_x509_privkey_sign_data(3)
π gnutls_x509_privkey_sign_data π
okay so bestie, welcome to the gnutls manual, page for gnutls_x509_privkey_sign_data(3). this one is literally about signing data with a private key and it's giving main character energy. let's get into it π«Ά
β¨ NAME β¨
gnutls_x509_privkey_sign_data β API function πΈ
π SYNOPSIS π
#include <gnutls/x509.h>
int gnutls_x509_privkey_sign_data(gnutls_x509_privkey_t key,
gnutls_digest_algorithm_t digest, unsigned int flags, const
gnutls_datum_t * data, void * signature, size_t * signature_size);
π ARGUMENTS π
gnutls_x509_privkey_t keyβ a key π that's it that's the arggnutls_digest_algorithm_t digestβ should be a digest algorithm, no capunsigned int flagsβ should be0for now (yes, just0, we're being so serious)const gnutls_datum_t * dataβ holds the data to be signed πvoid * signatureβ will contain the signature β¨size_t * signature_sizeβ holds the size ofsignature(and will be replaced by the new size π)
π DESCRIPTION π
so this function will sign the given data using a signature algorithm supported by the private key. signature algorithms are always used together with hash functions, they're like a package deal fr fr. different hash functions may be used for the RSA algorithm, but only SHA-1 for the DSA keys. that's just how it is bestie.
if the buffer provided is not long enough to hold the output, then *signature_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned. classic buffer situation, we've all been there π
use gnutls_x509_crt_get_preferred_hash_algorithm() to determine the hash algorithm. yes queen, go check what hash you should be using π§
β RETURNS β
on success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. negative = not slaying, 0 = slaying π
π REPORTING BUGS π
report bugs to <bugs@gnutls.org>. π§
home page: <https://www.gnutls.org> β no links here but like, you know, go look at it.
π 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. iconic behaviour honestly.
π¦ 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/>
periodt. that's the whole page. π
and that's a wrap on this page from the <strong>gnutls</strong> manual, version <strong>3.8.13</strong> (dated with the gnutls_x509_privkey_sign_data(3) header, if you were wondering) πβ¨ go forth and sign some data bestie, you've got this ππ¦
π¦ 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