1*e71b7053SJung-uk Kim=pod 2*e71b7053SJung-uk Kim 3*e71b7053SJung-uk Kim=head1 NAME 4*e71b7053SJung-uk Kim 5*e71b7053SJung-uk KimX509_check_ca - check if given certificate is CA certificate 6*e71b7053SJung-uk Kim 7*e71b7053SJung-uk Kim=head1 SYNOPSIS 8*e71b7053SJung-uk Kim 9*e71b7053SJung-uk Kim #include <openssl/x509v3.h> 10*e71b7053SJung-uk Kim 11*e71b7053SJung-uk Kim int X509_check_ca(X509 *cert); 12*e71b7053SJung-uk Kim 13*e71b7053SJung-uk Kim=head1 DESCRIPTION 14*e71b7053SJung-uk Kim 15*e71b7053SJung-uk KimThis function checks if given certificate is CA certificate (can be used 16*e71b7053SJung-uk Kimto sign other certificates). 17*e71b7053SJung-uk Kim 18*e71b7053SJung-uk Kim=head1 RETURN VALUES 19*e71b7053SJung-uk Kim 20*e71b7053SJung-uk KimFunction return 0, if it is not CA certificate, 1 if it is proper X509v3 21*e71b7053SJung-uk KimCA certificate with B<basicConstraints> extension CA:TRUE, 22*e71b7053SJung-uk Kim3, if it is self-signed X509 v1 certificate, 4, if it is certificate with 23*e71b7053SJung-uk KimB<keyUsage> extension with bit B<keyCertSign> set, but without 24*e71b7053SJung-uk KimB<basicConstraints>, and 5 if it has outdated Netscape Certificate Type 25*e71b7053SJung-uk Kimextension telling that it is CA certificate. 26*e71b7053SJung-uk Kim 27*e71b7053SJung-uk KimActually, any non-zero value means that this certificate could have been 28*e71b7053SJung-uk Kimused to sign other certificates. 29*e71b7053SJung-uk Kim 30*e71b7053SJung-uk Kim=head1 SEE ALSO 31*e71b7053SJung-uk Kim 32*e71b7053SJung-uk KimL<X509_verify_cert(3)>, 33*e71b7053SJung-uk KimL<X509_check_issued(3)>, 34*e71b7053SJung-uk KimL<X509_check_purpose(3)> 35*e71b7053SJung-uk Kim 36*e71b7053SJung-uk Kim=head1 COPYRIGHT 37*e71b7053SJung-uk Kim 38*e71b7053SJung-uk KimCopyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. 39*e71b7053SJung-uk Kim 40*e71b7053SJung-uk KimLicensed under the OpenSSL license (the "License"). You may not use 41*e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 42*e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 43*e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 44*e71b7053SJung-uk Kim 45*e71b7053SJung-uk Kim=cut 46