1=pod
2
3=head1 NAME
4
5PEM_X509_INFO_read_ex, PEM_X509_INFO_read, PEM_X509_INFO_read_bio_ex, PEM_X509_INFO_read_bio
6- read PEM-encoded data structures into one or more B<X509_INFO> objects
7
8=head1 SYNOPSIS
9
10 #include <openssl/pem.h>
11
12 STACK_OF(X509_INFO) *PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk,
13                                            pem_password_cb *cb, void *u,
14                                            OSSL_LIB_CTX *libctx,
15                                            const char *propq);
16 STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
17                                         pem_password_cb *cb, void *u);
18 STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bio,
19                                                STACK_OF(X509_INFO) *sk,
20                                                pem_password_cb *cb, void *u,
21                                                OSSL_LIB_CTX *libctx,
22                                                const char *propq);
23 STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
24                                             pem_password_cb *cb, void *u);
25
26=head1 DESCRIPTION
27
28PEM_X509_INFO_read_ex() loads the B<X509_INFO> objects from a file I<fp>.
29
30PEM_X509_INFO_read() is similar to PEM_X509_INFO_read_ex()
31but uses the default (NULL) library context I<libctx>
32and empty property query I<propq>.
33
34PEM_X509_INFO_read_bio_ex() loads the B<X509_INFO> objects using a bio I<bp>.
35
36PEM_X509_INFO_read_bio() is similar to PEM_X509_INFO_read_bio_ex()
37but uses the default (NULL) library context I<libctx>
38and empty property query I<propq>.
39
40Each of the loaded B<X509_INFO> objects can contain a CRL, a certificate,
41and/or a private key.
42The elements are read sequentially, and as far as they are of different type than
43the elements read before, they are combined into the same B<X509_INFO> object.
44The idea behind this is that if, for instance, a certificate is followed by
45a private key, the private key is supposed to correspond to the certificate.
46
47If the input stack I<sk> is NULL a new stack is allocated,
48else the given stack is extended.
49
50The optional I<cb> and I<u> parameters can be used for providing a pass phrase
51needed for decrypting encrypted PEM structures (normally only private keys).
52See L<PEM_read_bio_PrivateKey(3)> and L<passphrase-encoding(7)> for details.
53
54The library context I<libctx> and property query I<propq> are used for fetching
55algorithms from providers.
56
57=head1 RETURN VALUES
58
59PEM_X509_INFO_read_ex(), PEM_X509_INFO_read(),
60PEM_X509_INFO_read_bio_ex() and PEM_X509_INFO_read_bio() return
61a stack of B<X509_INFO> objects or NULL on failure.
62
63=head1 SEE ALSO
64
65L<PEM_read_bio_ex(3)>,
66L<PEM_read_bio_PrivateKey(3)>,
67L<passphrase-encoding(7)>
68
69=head1 HISTORY
70
71The functions PEM_X509_INFO_read_ex() and
72PEM_X509_INFO_read_bio_ex() were added in OpenSSL 3.0.
73
74=head1 COPYRIGHT
75
76Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
77
78Licensed under the Apache License 2.0 (the "License").  You may not use
79this file except in compliance with the License.  You can obtain a copy
80in the file LICENSE in the source distribution or at
81L<https://www.openssl.org/source/license.html>.
82
83=cut
84