gnutls_x509_crq_get_key_usage(3)
β¨ gnutls_x509_crq_get_key_usage β¨
okay so bestie, this one lives in the gnutls manual, section 3, and it's about peeking at the key usage extension inside a certificate request π
π NAME π
gnutls_x509_crq_get_key_usage β it's literally an API function, that's the whole name, no notes π
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crq_get_key_usage(gnutls_x509_crq_t crq, unsigned int *
key_usage, unsigned int * critical);
π¦ ARGUMENTS π¦
gnutls_x509_crq_t crqβ bestie this one should contain agnutls_x509_crq_ttype, like that's the vibe it needs to be giving β¨unsigned int * key_usageβ this is where the key usage bits get stored, it's the lil container okay π«Άunsigned int * criticalβ will be non-zero if the extension is marked as critical. so if it's critical, this is giving nonzero π
π DESCRIPTION π
So this function returns the certificate's key usage by reading the keyUsage X.509 extension, which is 2.5.29.15 if you're keeping track π
And the key usage value? It's the ORed values of these absolute icons:
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
all of them, no skipping, they're a set and they ate π₯
π RETURNS π
It hands you back the certificate key usage π β¦ or a negative error code in case of parsing error π
And listen β if the certificate does not contain the keyUsage extension, you get GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE returned. that's the whole message, no cap, it's just not there π
β SINCE β
2.8.0 β it's been iconic since 2.8.0, we stan a legacy π
π REPORTING BUGS π
Found a bug? Report it to <bugs@gnutls.org> β they want to hear it fr fr π«Ά
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, remix it, just 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/
and that's the whole page, periodt β¨ this was gnutls_x509_crq_get_key_usage(3), brought to you by gnutls 3.8.13 β mwah, go read your certs ππΈπ¦
π¦ 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