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