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 agnutls_x509_crt_ttype. 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: usegnutls_x509_crt_get_basic_constraints()if you also wanna read thepathLenConstraintfield 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
basicConstraintsextension βGNUTLS_E_REQUESTED_DATA_NOT_AVAILABLEwill 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 π
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
- 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