gnutls_x509_crt_sign2(3)
β¨ gnutls_x509_crt_sign2 β¨
okay bestie, gather round, because this is the gnutls_x509_crt_sign2(3) page from the gnutls manual and it's literally the moment your certificate gets its official signature π
πΈ NAME πΈ
gnutls_x509_crt_sign2 β it's an API function, periodt β¨
π SYNOPSIS π
#include <gnutls/x509.h>
int gnutls_x509_crt_sign2(gnutls_x509_crt_t crt, gnutls_x509_crt_t
issuer, gnutls_x509_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 your main character, the one getting signed πgnutls_x509_crt_t issuerβ is the certificate of the certificate issuer. the whole "who's vouching for you" situation π«Άgnutls_x509_privkey_t issuer_keyβ holds the issuer's private key π keep it safe, no capgnutls_digest_algorithm_t digβ The message digest to use,GNUTLS_DIG_SHA256is a safe choice. like, genuinely, just use SHA256 bestie πunsigned int flagsβ must be0. that's it. that's the whole assignment. zero. π«
π DESCRIPTION π
so this function will sign the certificate with the issuer's private key, and will copy the issuer's information into the certificate. two things, one call, slay β¨
This must be the last step in a certificate generation since all the previously set parameters are now signed. like, once you do this, the door is closed, the vibe is locked in, everything before it is now part of the signed package. so don't be out here calling it early, okay? π
A known limitation of this function is, that a newly-signed certificate will not be fully functional (e.g., for signature verification), until it is exported an re-imported.
yeah bestie that's real, that's in the docs, that's not me being dramatic π export it, re-import it, then it's fully functional. the way that it just has to be Like That... it's giving "known limitation" and we respect it π
After GnuTLS 3.6.1 the value of dig may be GNUTLS_DIG_UNKNOWN, and in that case, a suitable but reasonable for the key algorithm will be selected. so if you're on the newer side of things, you can just hand it GNUTLS_DIG_UNKNOWN and it'll pick something appropriate for the key algorithm itself π§ lowkey convenient
π RETURNS π
On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so if you see 0, we're winning, if you see negative, something went sideways and you gotta go read the error π
π REPORTING BUGS π
found a bug? tell the gnutls girlies: 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. like, go off, share it, just keep the notice, that's the deal π«Ά
π 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 is gnutls version 3.8.13, page gnutls_x509_crt_sign2(3), and it's dated with that same version tag β go forth and sign responsibly, mwah ππβ¨
π¦ 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