diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/man/X509_print_ex.3 | 279 |
1 files changed, 0 insertions, 279 deletions
diff --git a/src/lib/libcrypto/man/X509_print_ex.3 b/src/lib/libcrypto/man/X509_print_ex.3 deleted file mode 100644 index c769e77c32..0000000000 --- a/src/lib/libcrypto/man/X509_print_ex.3 +++ /dev/null | |||
@@ -1,279 +0,0 @@ | |||
1 | .\" $OpenBSD: X509_print_ex.3,v 1.5 2025/03/09 14:02:46 tb Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
4 | .\" | ||
5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
7 | .\" copyright notice and this permission notice appear in all copies. | ||
8 | .\" | ||
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | .\" | ||
17 | .Dd $Mdocdate: March 9 2025 $ | ||
18 | .Dt X509_PRINT_EX 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm X509_print_ex , | ||
22 | .Nm X509_CERT_AUX_print , | ||
23 | .Nm X509_print_ex_fp , | ||
24 | .Nm X509_print , | ||
25 | .Nm X509_print_fp | ||
26 | .Nd pretty-print an X.509 certificate | ||
27 | .Sh SYNOPSIS | ||
28 | .In openssl/x509.h | ||
29 | .Ft int | ||
30 | .Fo X509_print_ex | ||
31 | .Fa "BIO *bio" | ||
32 | .Fa "X509 *x" | ||
33 | .Fa "unsigned long nameflags" | ||
34 | .Fa "unsigned long skipflags" | ||
35 | .Fc | ||
36 | .Ft int | ||
37 | .Fo X509_CERT_AUX_print | ||
38 | .Fa "BIO *bio" | ||
39 | .Fa "X509_CERT_AUX *aux" | ||
40 | .Fa "int indent" | ||
41 | .Fc | ||
42 | .Ft int | ||
43 | .Fo X509_print_ex_fp | ||
44 | .Fa "FILE *fp" | ||
45 | .Fa "X509 *x" | ||
46 | .Fa "unsigned long nameflags" | ||
47 | .Fa "unsigned long skipflags" | ||
48 | .Fc | ||
49 | .Ft int | ||
50 | .Fo X509_print | ||
51 | .Fa "BIO *bio" | ||
52 | .Fa "X509 *x" | ||
53 | .Fc | ||
54 | .Ft int | ||
55 | .Fo X509_print_fp | ||
56 | .Fa "FILE *fp" | ||
57 | .Fa "X509 *x" | ||
58 | .Fc | ||
59 | .Sh DESCRIPTION | ||
60 | .Fn X509_print_ex | ||
61 | prints information contained in | ||
62 | .Fa x | ||
63 | to | ||
64 | .Fa bio | ||
65 | in human-readable form. | ||
66 | Printing is aborted as soon as any operation fails, with the exception | ||
67 | that failures while attempting to decode or print the public key, | ||
68 | the X.509 version 3 extensions, or non-standard auxiliary data are | ||
69 | not considered as errors. | ||
70 | .Pp | ||
71 | By default, the following blocks of information are printed | ||
72 | in the following order. | ||
73 | Each block can be skipped by setting the corresponding bit in | ||
74 | .Fa skipflags , | ||
75 | provided in parentheses after each block description. | ||
76 | .Bl -bullet | ||
77 | .It | ||
78 | A pair of lines reading | ||
79 | .Qq Certificate:\& | ||
80 | and | ||
81 | .Qq Data:\& | ||
82 | containing no information. | ||
83 | .Pq Dv X509_FLAG_NO_HEADER | ||
84 | .It | ||
85 | The certificate version number as defined by the standard, | ||
86 | followed in parentheses by the value contained in the version field | ||
87 | in hexadecimal notation. | ||
88 | See | ||
89 | .Xr X509_get_version 3 | ||
90 | for details. | ||
91 | .Pq Dv X509_FLAG_NO_VERSION | ||
92 | .It | ||
93 | The serial number of the certificate as returned by | ||
94 | .Xr X509_get_serialNumber 3 . | ||
95 | If it is not \-1 and converting it to | ||
96 | .Vt long | ||
97 | succeeds, it is printed in both decimal and hexadecimal format. | ||
98 | If it is \-1, too wide to fit in | ||
99 | .Vt long , | ||
100 | or conversion fails, it is printed byte-by-byte in hexadecimal notation. | ||
101 | .Pq Dv X509_FLAG_NO_SERIAL | ||
102 | .It | ||
103 | The name of the signature algorithm is printed with | ||
104 | .Xr X509_signature_print 3 . | ||
105 | .Pq Dv X509_FLAG_NO_SIGNAME | ||
106 | .It | ||
107 | The issuer name returned by | ||
108 | .Xr X509_get_issuer_name 3 | ||
109 | is printed with | ||
110 | .Xr X509_NAME_print_ex 3 . | ||
111 | .Pq Dv X509_FLAG_NO_ISSUER | ||
112 | .It | ||
113 | The validity period from | ||
114 | .Xr X509_get_notBefore 3 | ||
115 | to | ||
116 | .Xr X509_get_notAfter 3 | ||
117 | is printed using | ||
118 | .Xr ASN1_TIME_print 3 . | ||
119 | .Pq Dv X509_FLAG_NO_VALIDITY | ||
120 | .It | ||
121 | The subject name returned from | ||
122 | .Xr X509_get_subject_name 3 | ||
123 | is printed with | ||
124 | .Xr X509_NAME_print_ex 3 . | ||
125 | .Pq Dv X509_FLAG_NO_SUBJECT | ||
126 | .It | ||
127 | The public key algorithm is printed with | ||
128 | .Xr i2a_ASN1_OBJECT 3 , | ||
129 | and the public key returned from | ||
130 | .Xr X509_get_pubkey 3 | ||
131 | with | ||
132 | .Xr EVP_PKEY_print_public 3 . | ||
133 | .Pq Dv X509_FLAG_NO_PUBKEY | ||
134 | .It | ||
135 | All X.509 extensions contained in the certificate are printed with | ||
136 | .Xr X509V3_extensions_print 3 . | ||
137 | .Pq Dv X509_FLAG_NO_EXTENSIONS | ||
138 | .It | ||
139 | The signature is printed with | ||
140 | .Xr X509_signature_print 3 . | ||
141 | .Pq Dv X509_FLAG_NO_SIGDUMP | ||
142 | .It | ||
143 | Non-standard auxiliary data associated with the certificate is printed | ||
144 | using the function | ||
145 | .Fn X509_CERT_AUX_print | ||
146 | documented below. | ||
147 | .Pq Dv X509_FLAG_NO_AUX | ||
148 | .El | ||
149 | .Pp | ||
150 | The | ||
151 | .Fa nameflags | ||
152 | argument modifies the format for printing X.501 | ||
153 | .Vt Name | ||
154 | objects contained in | ||
155 | .Fa x . | ||
156 | It is passed through to | ||
157 | .Xr X509_NAME_print_ex 3 . | ||
158 | If | ||
159 | .Fa nameflags | ||
160 | is | ||
161 | .Dv X509_FLAG_COMPAT , | ||
162 | the | ||
163 | .Fa indent | ||
164 | argument of | ||
165 | .Xr X509_NAME_print_ex 3 | ||
166 | is set to 16 spaces and the traditional SSLeay format is used. | ||
167 | Otherwise, if the only bit set in | ||
168 | .Dv XN_FLAG_SEP_MASK | ||
169 | is | ||
170 | .Dv XN_FLAG_SEP_MULTILINE , | ||
171 | .Fa indent | ||
172 | is set to 12 spaces. | ||
173 | Otherwise, | ||
174 | .Fa indent | ||
175 | is set to zero. | ||
176 | .Pp | ||
177 | .Fn X509_CERT_AUX_print | ||
178 | prints information contained in | ||
179 | .Fa aux | ||
180 | to | ||
181 | .Fa bio | ||
182 | in human-readable form with a left margin of | ||
183 | .Fa indent | ||
184 | spaces. | ||
185 | If | ||
186 | .Fa aux | ||
187 | is | ||
188 | .Dv NULL , | ||
189 | it prints nothing. | ||
190 | .Pp | ||
191 | Information is printed in the following order: | ||
192 | .Bl -bullet | ||
193 | .It | ||
194 | Purposes the certificate is intended to be used for as set with | ||
195 | .Xr X509_add1_trust_object 3 , | ||
196 | each printed with | ||
197 | .Xr OBJ_obj2txt 3 . | ||
198 | .It | ||
199 | Purposes the certificate is explicitly | ||
200 | .Em not | ||
201 | intended to be used for as set with | ||
202 | .Xr X509_add1_reject_object 3 , | ||
203 | again each printed with | ||
204 | .Xr OBJ_obj2txt 3 . | ||
205 | .It | ||
206 | If | ||
207 | .Fa aux | ||
208 | contains data set with | ||
209 | .Xr X509_alias_set1 3 , | ||
210 | the raw bytes are printed in unencoded form. | ||
211 | .It | ||
212 | If | ||
213 | .Fa aux | ||
214 | contains data set with | ||
215 | .Xr X509_keyid_set1 3 , | ||
216 | the bytes are printed in hexadecimal notation with colons in between. | ||
217 | .El | ||
218 | .Pp | ||
219 | .Fn X509_print_ex_fp | ||
220 | is similar to | ||
221 | .Fn X509_print_ex | ||
222 | except that it prints to | ||
223 | .Fa fp . | ||
224 | .Pp | ||
225 | .Fn X509_print | ||
226 | and | ||
227 | .Fn X509_print_fp | ||
228 | are wrapper functions setting the | ||
229 | .Fa nameflags | ||
230 | to | ||
231 | .Dv XN_FLAG_COMPAT | ||
232 | and the | ||
233 | .Fa skipflags | ||
234 | to | ||
235 | .Dv X509_FLAG_COMPAT . | ||
236 | .Sh RETURN VALUES | ||
237 | .Fn X509_print_ex , | ||
238 | .Fn X509_print_ex_fp , | ||
239 | .Fn X509_print , | ||
240 | and | ||
241 | .Fn X509_print_fp | ||
242 | return 1 if all requested information was successfully printed, | ||
243 | even if failures occurred while attempting to decode or print the | ||
244 | public key or X.509 version 3 extensions, or 0 if any other operation | ||
245 | failed. | ||
246 | .Pp | ||
247 | .Fn X509_CERT_AUX_print | ||
248 | always returns 1 and silently ignores write errors. | ||
249 | .Sh SEE ALSO | ||
250 | .Xr BIO_new 3 , | ||
251 | .Xr X509_CERT_AUX_new 3 , | ||
252 | .Xr X509_CRL_print 3 , | ||
253 | .Xr X509_new 3 , | ||
254 | .Xr X509_REQ_print_ex 3 | ||
255 | .Sh HISTORY | ||
256 | .Fn X509_print | ||
257 | first appeared in SSLeay 0.5.1 and was changed to print to a | ||
258 | .Vt BIO | ||
259 | in SSLeay 0.6.0. | ||
260 | .Fn X509_print_fp | ||
261 | first appeared in SSLeay 0.6.0. | ||
262 | Both functions have been available since | ||
263 | .Ox 2.4 . | ||
264 | .Pp | ||
265 | .Fn X509_CERT_AUX_print | ||
266 | first appeared in OpenSSL 0.9.5 and has been available since | ||
267 | .Ox 2.7 . | ||
268 | .Pp | ||
269 | .Fn X509_print_ex | ||
270 | and | ||
271 | .Fn X509_print_ex_fp | ||
272 | first appeared in OpenSSL 0.9.7 and have been available since | ||
273 | .Ox 3.2 . | ||
274 | .Sh BUGS | ||
275 | If arbitrary data was stored into | ||
276 | .Fa x | ||
277 | using | ||
278 | .Xr X509_alias_set1 3 , | ||
279 | these functions may print binary data and even NUL bytes. | ||