SSL_load_client_CA_file.pod 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. =pod
  2. =head1 NAME
  3. SSL_load_client_CA_file - load certificate names from file
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
  7. =head1 DESCRIPTION
  8. SSL_load_client_CA_file() reads certificates from B<file> and returns
  9. a STACK_OF(X509_NAME) with the subject names found.
  10. =head1 NOTES
  11. SSL_load_client_CA_file() reads a file of PEM formatted certificates and
  12. extracts the X509_NAMES of the certificates found. While the name suggests
  13. the specific usage as support function for
  14. L<SSL_CTX_set_client_CA_list(3)>,
  15. it is not limited to CA certificates.
  16. =head1 RETURN VALUES
  17. The following return values can occur:
  18. =over 4
  19. =item NULL
  20. The operation failed, check out the error stack for the reason.
  21. =item Pointer to STACK_OF(X509_NAME)
  22. Pointer to the subject names of the successfully read certificates.
  23. =back
  24. =head1 EXAMPLES
  25. Load names of CAs from file and use it as a client CA list:
  26. SSL_CTX *ctx;
  27. STACK_OF(X509_NAME) *cert_names;
  28. ...
  29. cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem");
  30. if (cert_names != NULL)
  31. SSL_CTX_set_client_CA_list(ctx, cert_names);
  32. else
  33. /* error */
  34. ...
  35. =head1 SEE ALSO
  36. L<ssl(7)>,
  37. L<SSL_CTX_set_client_CA_list(3)>
  38. =head1 COPYRIGHT
  39. Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
  40. Licensed under the Apache License 2.0 (the "License"). You may not use
  41. this file except in compliance with the License. You can obtain a copy
  42. in the file LICENSE in the source distribution or at
  43. L<https://www.openssl.org/source/license.html>.
  44. =cut