Debian Codegraph @

upstream/debian-unstable/man3/PEM_read_bio_ex.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "PEM_READ_BIO_EX 3SSL"
58 .TH PEM_READ_BIO_EX 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 PEM_read_bio_ex, PEM_FLAG_SECURE, PEM_FLAG_EAY_COMPATIBLE,
65 PEM_FLAG_ONLY_B64 \- read PEM format files with custom processing
66 .SH SYNOPSIS
67 .IX Header "SYNOPSIS"
68 .Vb 1
69 \& #include <openssl/pem.h>
70 \&
71 \& #define PEM_FLAG_SECURE 0x1
72 \& #define PEM_FLAG_EAY_COMPATIBLE 0x2
73 \& #define PEM_FLAG_ONLY_B64 0x4
74 \& int PEM_read_bio_ex(BIO *in, char **name, char **header,
75 \& unsigned char **data, long *len, unsigned int flags);
76 .Ve
77 .SH DESCRIPTION
78 .IX Header "DESCRIPTION"
79 \&\fBPEM_read_bio_ex()\fR reads in PEM formatted data from an input BIO, outputting
80 the name of the type of contained data, the header information regarding
81 the possibly encrypted data, and the binary data payload (after base64 decoding).
82 It should generally only be used to implement PEM_read_bio_\-family functions
83 for specific data types or other usage, but is exposed to allow greater flexibility
84 over how processing is performed, if needed.
85 .PP
86 If PEM_FLAG_SECURE is set, the intermediate buffers used to read in lines of
87 input are allocated from the secure heap.
88 .PP
89 If PEM_FLAG_EAY_COMPATIBLE is set, a simple algorithm is used to remove whitespace
90 and control characters from the end of each line, so as to be compatible with
91 the historical behavior of \fBPEM_read_bio()\fR.
92 .PP
93 If PEM_FLAG_ONLY_B64 is set, all characters are required to be valid base64
94 characters (or newlines); non\-base64 characters are treated as end of input.
95 .PP
96 If neither PEM_FLAG_EAY_COMPATIBLE or PEM_FLAG_ONLY_B64 is set, control characters
97 are ignored.
98 .PP
99 If both PEM_FLAG_EAY_COMPATIBLE and PEM_FLAG_ONLY_B64 are set, an error is returned;
100 these options are not compatible with each other.
101 .SH NOTES
102 .IX Header "NOTES"
103 The caller must release the storage allocated for *name, *header, and *data.
104 If PEM_FLAG_SECURE was set, use \fBOPENSSL_secure_free()\fR; otherwise,
105 \&\fBOPENSSL_free()\fR is used.
106 .SH "RETURN VALUES"
107 .IX Header "RETURN VALUES"
108 \&\fBPEM_read_bio_ex()\fR returns 1 for success or 0 for failure.
109 .SH "SEE ALSO"
110 .IX Header "SEE ALSO"
111 \&\fBPEM_bytes_read_bio\fR\|(3)
112 .SH HISTORY
113 .IX Header "HISTORY"
114 The \fBPEM_read_bio_ex()\fR function was added in OpenSSL 1.1.1.
115 .SH COPYRIGHT
116 .IX Header "COPYRIGHT"
117 Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
118 .PP
119 Licensed under the Apache License 2.0 (the "License"). You may not use
120 this file except in compliance with the License. You can obtain a copy
121 in the file LICENSE in the source distribution or at
122 <https://www.openssl.org/source/license.html>.