gnutls_x509_crt_privkey_sign(3)
π gnutls_x509_crt_privkey_sign β the glow-up moment π
okay bestie, so this one is from the gnutls manual, and it's the final boss of certificate making. it's literally the part where your cert gets its signature and becomes a real one. main character energy fr fr β¨
β¨ NAME β¨
gnutls_x509_crt_privkey_sign β an API function, no cap π«Ά
π SYNOPSIS π
#include <gnutls/abstract.h>
int gnutls_x509_crt_privkey_sign(gnutls_x509_crt_t crt,
gnutls_x509_crt_t issuer, gnutls_privkey_t issuer_key,
gnutls_digest_algorithm_t dig, unsigned int flags);
πΈ ARGUMENTS πΈ
gnutls_x509_crt_t crtβ a certificate of typegnutls_x509_crt_t. this is the baby you're signing πgnutls_x509_crt_t issuerβ is the certificate of the certificate issuer. the one doing the signing, the queen bee πgnutls_privkey_t issuer_keyβ holds the issuer's private key π keep it safe, don't be out here leaking itgnutls_digest_algorithm_t digβ The message digest to use.GNUTLS_DIG_SHA256is a safe choice. like, just pick SHA256 bestie, it's the safe one πunsigned int flagsβ must be0. that's it. zero. nothing else. periodt π
π¦ DESCRIPTION π¦
so what does this do? it signs the certificate with the issuer's private key, and β here's the cute part β it copies the issuer's information into the certificate. like, the issuer's whole vibe gets transferred over. it's giving β¨inheritanceβ¨
this has to be the last step in a certificate generation. like, THE last one. because all the previously set parameters are now signed. once you do this, everything you set before is locked in. no take-backs, no edits, no "wait actuallyβ" π
ngl there's a known limitation of this function that you need to know about: a newly-signed certificate will not be fully functional (e.g., for signature verification) until it is exported and re-imported. yeah. it's a whole thing. you sign it, then you gotta ship it out and bring it back for it to work properly. iykyk π
and a lil glow-up note: after GnuTLS 3.6.1 the value of dig may be GNUTLS_DIG_UNKNOWN, and in that case, a suitable but reasonable one for the key algorithm will be selected. so if you don't feel like choosing, the library chooses for you. slay π
β RETURNS β
On success, GNUTLS_E_SUCCESS (0) is returned. otherwise it's a negative error value. negative = not the vibe, go check your error handling bestie π
π REPORTING BUGS π
found a bug? don't gatekeep, report it:
- 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.
π« 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/
okay that's the whole page, you ate that π«Ά go sign some certificates responsibly, and remember: export and re-import or it won't work, that's not me being dramatic that's literally in the docs π
this was page gnutls_x509_crt_privkey_sign(3) from gnutls 3.8.13 β mwah, stan the Free Software Foundation, bye bestie πβ¨
π¦ 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