gnutls_x509_ext_import_key_usage(3)
β¨ gnutls_x509_ext_import_key_usage β¨
okay bestie, welcome to the gnutls manual page for gnutls_x509_ext_import_key_usage(3) π this is an API function and it's here to tell you exactly what a cert is and isn't allowed to do, no cap.
πΈ NAME πΈ
gnutls_x509_ext_import_key_usage β it's an API function, bestie. that's the whole name vibe.
π SYNOPSIS π
#include <gnutls/x509-ext.h>
int gnutls_x509_ext_import_key_usage(const gnutls_datum_t * ext,
unsigned int * key_usage);
like, that's the whole call. two args, one int back, we move. π
π¦ ARGUMENTS π¦
const gnutls_datum_t * extβ this is the DER encoded extension data. it's the raw bytes, the actual material, the moment before the glow-up. β¨unsigned int * key_usageβ this is where the key usage bits will be stored. you hand it a pointer and it fills it in, like a bestie holding your bag while you take a pic. π«Ά
π DESCRIPTION π
so this function will return the certificate's key usage, okay? it does that by reading the DER data of the keyUsage X.509 extension, which is 2.5.29.15 (iykyk, that's the OID). π§
the key usage value you get back will be ORed values of these bad boys right here:
GNUTLS_KEY_DIGITAL_SIGNATUREGNUTLS_KEY_NON_REPUDIATIONGNUTLS_KEY_KEY_ENCIPHERMENTGNUTLS_KEY_DATA_ENCIPHERMENTGNUTLS_KEY_KEY_AGREEMENTGNUTLS_KEY_KEY_CERT_SIGNGNUTLS_KEY_CRL_SIGNGNUTLS_KEY_ENCIPHER_ONLYGNUTLS_KEY_DECIPHER_ONLY
it's giving bitmask realness. they all get mashed together into that one unsigned int and it's your job to pick them apart. π
β RETURNS β
you get back the certificate key usage, or a negative error code if the parsing went sideways. π
and listen β if the certificate does not contain the keyUsage extension at all, you get GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE back. that's not a bug, that's just the cert being mysterious. π
π SINCE π
3.3.0 β she's been iconic for a minute, fr fr.
π REPORTING BUGS π
found a bug? spill it to <bugs@gnutls.org>. π§
home page is right here: https://www.gnutls.org β go say hi. β¨
π 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. so like, keep the receipts, bestie. π«Ά
π₯ 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 it, you understood it, main character energy all around. π
signing off with love from gnutls 3.8.13 β that's the version and the vibe, 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