gnutls_pkcs7_sign(3)
π gnutls_pkcs7_sign β like, the PKCS#7 signing era π
okay bestie, this one lives in the gnutls manual (section 3, the library functions girlies), and it's literally the "put a signature on a PKCS 7 structure" function. no cap. let's get into it π
β¨ NAME β¨
gnutls_pkcs7_sign β API function π¦
β¨ SYNOPSIS β¨
#include <gnutls/pkcs7.h>
int gnutls_pkcs7_sign(gnutls_pkcs7_t pkcs7, gnutls_x509_crt_t signer,
gnutls_privkey_t signer_key, const gnutls_datum_t * data,
gnutls_pkcs7_attrs_t signed_attrs, gnutls_pkcs7_attrs_t unsigned_attrs,
gnutls_digest_algorithm_t dig, unsigned flags);
β¨ ARGUMENTS β¨
gnutls_pkcs7_t pkcs7β should contain agnutls_pkcs7_ttype πgnutls_x509_crt_t signerβ the certificate that's doing the signing of the structure πgnutls_privkey_t signer_keyβ the key that's doing the signing of the structure πconst gnutls_datum_t * dataβ the data to be signed, orNULLif the data are already embedded π«£gnutls_pkcs7_attrs_t signed_attrsβ any additional attributes to be included in the signed ones (orNULL) βοΈgnutls_pkcs7_attrs_t unsigned_attrsβ any additional attributes to be included in the unsigned ones (orNULL) πgnutls_digest_algorithm_t digβ the digest algorithm to use for signing πunsigned flagsβ should be zero or one of theGNUTLS_PKCS7flags β
β¨ DESCRIPTION β¨
so this function will add a signature into the PKCS 7 structure you handed it, for the data you handed it. that's the whole assignment bestie, and it ate π
and the iconic part? you can make multiple signatures with different signers. not me being a polyamorous-signature icon π₯
the available flags are: GNUTLS_PKCS7_EMBED_DATA, GNUTLS_PKCS7_INCLUDE_TIME, GNUTLS_PKCS7_INCLUDE_CERT, and GNUTLS_PKCS7_WRITE_SPKI. they are explained in the gnutls_pkcs7_sign_flags definition β go read that one, iykyk π
β¨ RETURNS β¨
on success, GNUTLS_E_SUCCESS (0) is returned π otherwise you get a negative error value π (it's giving "the vibe check failed", fr fr)
β¨ SINCE β¨
3.4.2 β a classic, been serving since way back π§
β¨ REPORTING BUGS β¨
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, that's the license, no gatekeeping here π
β¨ 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 π this was gnutls 3.8.13, dated with the gnutls_pkcs7_sign(3) footer energy β mwah, go sign something, 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