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 a gnutls_x509_crt_t type, like, that's the whole thing. It's the certificate we're interrogating πŸ•΅οΈβ™€οΈ
  • const char * purpose β€” a key purpose OID, okurrr? Like for example GNUTLS_KP_CODE_SIGNING. Yes it's a string, yes it's an OID, we contain multitudes ✨
  • unsigned flags β€” either zero, or GNUTLS_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:


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