gnutls_x509_crt_set_key_usage(3)
β¨ gnutls_x509_crt_set_key_usage β¨
okay bestie, pull up a chair, because we're doing certificate extensions today and honestly? it's giving main character energy π
this one lives in the gnutls manual β yeah, that gnutls, the TLS library that's been carrying the internet on its back since forever π«Ά
πΈ NAME πΈ
gnutls_x509_crt_set_key_usage β an API function, and no, it's not gonna explain itself, that's literally why we're here π
π SYNOPSIS π
#include <gnutls/x509.h>
int gnutls_x509_crt_set_key_usage(gnutls_x509_crt_t crt, unsigned int
usage);
like, that's the whole vibe. two arguments, one int coming back at you π₯
π¦ ARGUMENTS π¦
gnutls_x509_crt_t crtβ a certificate of typegnutls_x509_crt_t. yes the type is literally named the same as the argument, that's just how gnutls rolls, we don't question it π this is the cert you're about to mess with.unsigned int usageβ an ORed sequence of theGNUTLS_KEY_*elements. so you're not passing one single thing, you're passing a lil bundle β bitwise-OR them together and hand the whole stack over. it's giving β¨combination platterβ¨
π DESCRIPTION π
This function will set the keyUsage certificate extension.
that's it. that's the whole job. you hand it a cert, you hand it a usage (or several ORed together), and it stamps that keyUsage extension right onto the certificate. iconic. no cap π
π RETURNS π
On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value.
so like β 0 means slay, anything negative means something went sideways and you should go read the error code, fr fr. don't ignore a negative return, that's the universe telling you something π
π REPORTING BUGS π
found a bug? don't suffer in silence bestie, tell the people:
- 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.
(translation: go forth and share, just keep the receipts π§Ύπ)
π 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/
lowkey if the local docs aren't there, the website always has you. no gatekeeping in this house π«Ά
and that's the page, bestie!! written by the gnutls girlies, version 3.8.13, under the gnutls manual β gnutls_x509_crt_set_key_usage(3), 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