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