gnutls_x509_crq_privkey_sign(3)

πŸ’– gnutls_x509_crq_privkey_sign(3) πŸ’–

okay bestie, so this page lives in the gnutls manual, and it's all about the moment your certificate request finally gets its signature. it's giving "final boss of CRQ building" energy, fr fr.


✨ NAME ✨

gnutls_x509_crq_privkey_sign β€” an API function, and yes she's the one who does the signing πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_x509_crq_privkey_sign(gnutls_x509_crq_t crq, gnutls_privkey_t
key, gnutls_digest_algorithm_t dig, unsigned int flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crq_t crq β€” should contain a gnutls_x509_crq_t type. she's the certificate request getting the glow-up ✨
  • gnutls_privkey_t key β€” holds a private key. the secret sauce, the moment, the key πŸ”‘
  • gnutls_digest_algorithm_t dig β€” the message digest to use, i.e., GNUTLS_DIG_SHA1
  • unsigned int flags β€” must be 0. that's it. zero. no notes 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function signs the certificate request with a private key. that's the whole vibe. and listen β€” this must be the same key as the one used in gnutls_x509_crt_set_key(), because a certificate request is self signed. it's signing itself, main character behavior, honestly πŸ’…

this has to be the last step in a certificate request generation, because all the previously set parameters are now signed. once you call this, you're done, no going back, the ink is dry periodt.

⚠️ a known limitation of this function is, that a newly-signed request will not be fully functional (e.g., for signature verification), until it is exported an re-imported. yes bestie, you read that right β€” export and re-import it before you trust it fully. it's a whole thing. don't skip it, no cap.

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 you can just let her pick, and she'll choose something that makes sense for the key algorithm 🌈


⭐ RETURNS ⭐

GNUTLS_E_SUCCESS on success, otherwise a negative error code. classic.

and GNUTLS_E_ASN1_VALUE_NOT_FOUND is returned if you didn't set all information in the certificate request (e.g., the version using gnutls_x509_crq_set_version()). so if you're getting that error, check your version-setting, bestie, that's the vibe check failing 😭


🧚 SINCE 🧚

2.12.0 β€” she's been iconic for a minute πŸ‘‘


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found something cursed? report bugs to <bugs@gnutls.org>.

home page: https://www.gnutls.org


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, and legally so.


πŸ”₯ 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, and like all good things she came with her own date stamp at the bottom. go sign something, and remember: export and re-import. love u, bye πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from