gnutls_x509_crq_sign2(3)
π gnutls_x509_crq_sign2 β the "okay bestie, seal the deal" function π
Okay so real talk, this is from the gnutls manual pages (the x509 corner of it), and it's the moment where your certificate request finally gets β¨signedβ¨. It's the glow-up finale. Let's get into it.
β¨ SYNOPSIS β¨
#include <gnutls/x509.h>
int gnutls_x509_crq_sign2(gnutls_x509_crq_t crq, gnutls_x509_privkey_t key,
gnutls_digest_algorithm_t dig, unsigned int flags);
π ARGUMENTS π
gnutls_x509_crq_t crqβ bestie this should contain agnutls_x509_crq_ttype. That's the certificate request you're about to sign, the main character of this whole operation.gnutls_x509_privkey_t keyβ holds a private key. Yes, an actual private key. Guard it with your life, ngl.gnutls_digest_algorithm_t digβ the message digest to use, i.e.,GNUTLS_DIG_SHA256. Pick your vibe.unsigned int flagsβ must be0. That's it. Zero. No options, no extras, no sneaking anything in there. Periodt.
πΈ DESCRIPTION πΈ
This function signs the certificate request with a private key. And here's the tea: it has to be the same key as the one used in gnutls_x509_crt_set_key(), because a certificate request is self-signed. It's signing its own paperwork. Self-love, honestly. π
This also must be the last step in a certificate request generation, since every parameter you set before this point is now signed. Like, once you hit this, the ink is dry. No take-backs. So don't be out here setting stuff after.
β οΈ A known limitation of this function, and I need you to hear me on this one: a newly-signed request will not be fully functional (e.g., for signature verification) until it is exported and re-imported. The way that it needs a little round trip to become its true self. That's just how it is, no cap.
After GnuTLS 3.6.1, the value of dig may be GNUTLS_DIG_UNKNOWN, and in that case, a suitable but reasonable digest for the key algorithm will be selected for you. So if you're like "idk bestie, you pick," it will pick. π«Ά
π¦ RETURNS π¦
GNUTLS_E_SUCCESSon success β slay, you did it π- Otherwise, a negative error code. Sad girl hours π
GNUTLS_E_ASN1_VALUE_NOT_FOUNDis returned if you didn't set all the information in the certificate request (e.g., the version usinggnutls_x509_crq_set_version()). Basically you skipped a step and it's calling you out. Fill in your whole form before you submit it, bestie.
π REPORTING BUGS π
Found a bug? Don't gatekeep, report it 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/
And that's the whole page, bestie!! This was GnuTLS version 3.8.13, and you just read gnutls_x509_crq_sign2(3) in its full, unfiltered, extremely-signable glory. Go forth and sign responsibly πβ¨ππ¦
π¦ 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