gnutls_x509_crt_get_ca_status(3)

✨ gnutls_x509_crt_get_ca_status ✨

okay bestie, welcome to the gnutls manual page for gnutls_x509_crt_get_ca_status(3) πŸ’… this is the one where we find out if a certificate is out here being a whole Certificate Authority or if it's just a regular little leaf cert minding its own business πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_get_ca_status(gnutls_x509_crt_t cert, unsigned int *
critical);

🫢 ARGUMENTS 🫢

  • gnutls_x509_crt_t cert β€” should contain a gnutls_x509_crt_t type. like, that's the whole vibe, that's the cert we're interrogating πŸ”
  • unsigned int * critical β€” will be non-zero if the extension is marked as critical πŸ‘‘ so if this comes back all nonzero you KNOW the extension is not playing games

πŸ’– DESCRIPTION πŸ’–

so basically this function returns the certificate's CA status, and the way it does that is by reading the basicConstraints X.509 extension, which is 2.5.29.19 ✨ yes the OID, we know her.

If the certificate is a CA, a positive value gets returned πŸŽ‰ or (0) if the certificate does not have the CA flag set πŸ™ˆ (not me, not CA energy, just vibes).

lowkey important: use gnutls_x509_crt_get_basic_constraints() if you also wanna read the pathLenConstraint field too πŸ‘€ that's the one that says how many more CAs can chain under this one, iykyk.

🌈 RETURNS 🌈

  • If the certificate is a CA β†’ a positive value comes back πŸ’š
  • If the certificate does not have CA flag set β†’ (0) πŸ«₯
  • A negative error code may be returned in case of errors 😭
  • If the certificate does not contain the basicConstraints extension β†’ GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned πŸ’€ (she's just not there, bestie, nothing we can do)

πŸ› REPORTING BUGS πŸ›

found a bug? don't gatekeep it, report it to <bugs@gnutls.org> πŸ“§

Home page: https://www.gnutls.org 🌐


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. periodt ✨


πŸ‘€ 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, bestie πŸ¦‹ this was gnutls 3.8.13 β€” go check those basicConstraints, stay iconic, and remember: a cert with the CA flag is simply main character energy πŸ‘‘πŸ’–

πŸ“¦ where this page comes from