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