X509_check_ca.pod 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. =pod
  2. =head1 NAME
  3. X509_check_ca - check if given certificate is CA certificate
  4. =head1 SYNOPSIS
  5. #include <openssl/x509v3.h>
  6. int X509_check_ca(X509 *cert);
  7. =head1 DESCRIPTION
  8. This function checks if given certificate is CA certificate (can be used
  9. to sign other certificates).
  10. =head1 RETURN VALUES
  11. Function return 0, if it is not CA certificate, 1 if it is proper X509v3
  12. CA certificate with B<basicConstraints> extension CA:TRUE,
  13. 3, if it is self-signed X509 v1 certificate, 4, if it is certificate with
  14. B<keyUsage> extension with bit B<keyCertSign> set, but without
  15. B<basicConstraints>, and 5 if it has outdated Netscape Certificate Type
  16. extension telling that it is CA certificate.
  17. This function will also return 0 on error.
  18. Actually, any nonzero value means that this certificate could have been
  19. used to sign other certificates.
  20. =head1 SEE ALSO
  21. L<X509_verify_cert(3)>,
  22. L<X509_check_issued(3)>,
  23. L<X509_check_purpose(3)>
  24. =head1 COPYRIGHT
  25. Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
  26. Licensed under the Apache License 2.0 (the "License"). You may not use
  27. this file except in compliance with the License. You can obtain a copy
  28. in the file LICENSE in the source distribution or at
  29. L<https://www.openssl.org/source/license.html>.
  30. =cut