GNUTLS_X509_CRT_CHECK_KEY_PURPOSE(3)
β¨ NAME β¨
gnutls_x509_crt_check_key_purpose β it's an API function, bestie, and it's giving "does this cert even go here" π
This one lives in the gnutls manual, section 3, and it's basically a vibe check for key purposes. Obsessed.
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
unsigned gnutls_x509_crt_check_key_purpose(gnutls_x509_crt_t cert, const
char * purpose, unsigned flags);
π ARGUMENTS π
gnutls_x509_crt_t certβ bestie this should contain agnutls_x509_crt_ttype, like, that's the whole thing. It's the certificate we're interrogating π΅οΈβοΈconst char * purposeβ a key purpose OID, okurrr? Like for exampleGNUTLS_KP_CODE_SIGNING. Yes it's a string, yes it's an OID, we contain multitudes β¨unsigned flagsβ either zero, orGNUTLS_KP_FLAG_DISALLOW_ANY. That's the menu, pick your fighter π«Ά
π DESCRIPTION π
So this function will check whether the given certificate matches the provided key purpose. That's it, that's the job, and honestly? She's doing it beautifully. π
Now here's the tea though β the way that if flags contains GNUTLS_KP_FLAG_ALLOW_ANY then a certificate marked for any purpose will not match. Like, the flag says ALLOW and the result is... not a match. Not me reading this three times π (yes, the ARGUMENTS section up there says GNUTLS_KP_FLAG_DISALLOW_ANY and this line says GNUTLS_KP_FLAG_ALLOW_ANY β I am simply reporting what the page says, fr fr, no cap, I do not make the rules π)
β RETURNS β
- zero if the key purpose doesn't match
- non-zero otherwise
That's it. Binary queen. Zero or not-zero, no in-between, periodt. π
π¦ SINCE π¦
3.5.6 β she's been around since 3.5.6 and she's still iconic, we love a long-running main character π
πΈ REPORTING BUGS πΈ
Found a bug? Don't be shy, tell the devs:
- 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. Slay, and also legally binding, so keep the notice, bestie π«Ά
π SEE ALSO π
The full documentation for gnutls is maintained as a Texinfo manual. So if the /usr/share/doc/gnutls/ directory does not contain the HTML form, go visit:
https://www.gnutls.org/manual/
Like, the whole manual is right there. Go read it, it's giving β¨ comprehensive β¨
okay bye bestie, this page is from gnutls 3.8.13 and it ate, no crumbs left πβ¨ππ¦πΈπ π«Ά
π¦ 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