X509_CHECK_CA(3ossl)
Hey bestie, welcome to the X509_CHECK_CA(3ossl) page π this is your group-chat explainer for X509_check_ca, no cap.
β¨ NAME β¨
X509_check_ca β check if given certificate is CA certificate π
Okay so this whole page is about one function, X509_check_ca, and it's literally doing the vibe check: is this certificate a CA certificate? That's the whole assignment. π
πΈ SYNOPSIS πΈ
#include <openssl/x509v3.h>
int X509_check_ca(X509 *cert);
So you pull in <openssl/x509v3.h>, then you call X509_check_ca(cert) with your X509 *cert. Easy. β¨
π¦ DESCRIPTION π¦
This function checks if the given certificate is a CA certificate β meaning it can be used to sign other certificates. That's the main-character job of a CA cert, bestie. π«Ά
The certificate must be a complete certificate, otherwise an error is returned. So don't slide in with half a cert and expect magic, okay? π
π RETURN VALUES π
The return values are doing a little numbered lineup, and every one matters:
0β nope, it is not a CA certificate.1β yes bestie, it is a properX509v3CA certificate with thebasicConstraintsextensionCA:TRUE. π3β it is a self-signedX509 v1certificate.4β it is a certificate with thekeyUsageextension with bitkeyCertSignset, but withoutbasicConstraints.5β it has the outdated Netscape Certificate Type extension telling that it is a CA certificate.
Also: this function will also return 0 on error. So 0 is doing double duty β "not CA" and "oops, error" β which is lowkey chaotic, but that's the tea. π΅
And actually, any nonzero value means that this certificate could have been used to sign other certificates. So nonzero = "could've signed stuff", periodt. π₯
π SEE ALSO π
π COPYRIGHT π
Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
That's the whole page, bestie π cute sign-off time: this manual page is from OpenSSL 3.5.6, dated 2026-04-07. Go forth and check those CAs. πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms