summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_print_ex.3
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2025-04-14 17:32:06 +0000
committercvs2svn <admin@example.com>2025-04-14 17:32:06 +0000
commiteb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch)
treeedb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libcrypto/man/X509_print_ex.3
parent247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff)
downloadopenbsd-tb_20250414.tar.gz
openbsd-tb_20250414.tar.bz2
openbsd-tb_20250414.zip
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libcrypto/man/X509_print_ex.3')
-rw-r--r--src/lib/libcrypto/man/X509_print_ex.3279
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
61prints information contained in
62.Fa x
63to
64.Fa bio
65in human-readable form.
66Printing is aborted as soon as any operation fails, with the exception
67that failures while attempting to decode or print the public key,
68the X.509 version 3 extensions, or non-standard auxiliary data are
69not considered as errors.
70.Pp
71By default, the following blocks of information are printed
72in the following order.
73Each block can be skipped by setting the corresponding bit in
74.Fa skipflags ,
75provided in parentheses after each block description.
76.Bl -bullet
77.It
78A pair of lines reading
79.Qq Certificate:\&
80and
81.Qq Data:\&
82containing no information.
83.Pq Dv X509_FLAG_NO_HEADER
84.It
85The certificate version number as defined by the standard,
86followed in parentheses by the value contained in the version field
87in hexadecimal notation.
88See
89.Xr X509_get_version 3
90for details.
91.Pq Dv X509_FLAG_NO_VERSION
92.It
93The serial number of the certificate as returned by
94.Xr X509_get_serialNumber 3 .
95If it is not \-1 and converting it to
96.Vt long
97succeeds, it is printed in both decimal and hexadecimal format.
98If it is \-1, too wide to fit in
99.Vt long ,
100or conversion fails, it is printed byte-by-byte in hexadecimal notation.
101.Pq Dv X509_FLAG_NO_SERIAL
102.It
103The name of the signature algorithm is printed with
104.Xr X509_signature_print 3 .
105.Pq Dv X509_FLAG_NO_SIGNAME
106.It
107The issuer name returned by
108.Xr X509_get_issuer_name 3
109is printed with
110.Xr X509_NAME_print_ex 3 .
111.Pq Dv X509_FLAG_NO_ISSUER
112.It
113The validity period from
114.Xr X509_get_notBefore 3
115to
116.Xr X509_get_notAfter 3
117is printed using
118.Xr ASN1_TIME_print 3 .
119.Pq Dv X509_FLAG_NO_VALIDITY
120.It
121The subject name returned from
122.Xr X509_get_subject_name 3
123is printed with
124.Xr X509_NAME_print_ex 3 .
125.Pq Dv X509_FLAG_NO_SUBJECT
126.It
127The public key algorithm is printed with
128.Xr i2a_ASN1_OBJECT 3 ,
129and the public key returned from
130.Xr X509_get_pubkey 3
131with
132.Xr EVP_PKEY_print_public 3 .
133.Pq Dv X509_FLAG_NO_PUBKEY
134.It
135All 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
139The signature is printed with
140.Xr X509_signature_print 3 .
141.Pq Dv X509_FLAG_NO_SIGDUMP
142.It
143Non-standard auxiliary data associated with the certificate is printed
144using the function
145.Fn X509_CERT_AUX_print
146documented below.
147.Pq Dv X509_FLAG_NO_AUX
148.El
149.Pp
150The
151.Fa nameflags
152argument modifies the format for printing X.501
153.Vt Name
154objects contained in
155.Fa x .
156It is passed through to
157.Xr X509_NAME_print_ex 3 .
158If
159.Fa nameflags
160is
161.Dv X509_FLAG_COMPAT ,
162the
163.Fa indent
164argument of
165.Xr X509_NAME_print_ex 3
166is set to 16 spaces and the traditional SSLeay format is used.
167Otherwise, if the only bit set in
168.Dv XN_FLAG_SEP_MASK
169is
170.Dv XN_FLAG_SEP_MULTILINE ,
171.Fa indent
172is set to 12 spaces.
173Otherwise,
174.Fa indent
175is set to zero.
176.Pp
177.Fn X509_CERT_AUX_print
178prints information contained in
179.Fa aux
180to
181.Fa bio
182in human-readable form with a left margin of
183.Fa indent
184spaces.
185If
186.Fa aux
187is
188.Dv NULL ,
189it prints nothing.
190.Pp
191Information is printed in the following order:
192.Bl -bullet
193.It
194Purposes the certificate is intended to be used for as set with
195.Xr X509_add1_trust_object 3 ,
196each printed with
197.Xr OBJ_obj2txt 3 .
198.It
199Purposes the certificate is explicitly
200.Em not
201intended to be used for as set with
202.Xr X509_add1_reject_object 3 ,
203again each printed with
204.Xr OBJ_obj2txt 3 .
205.It
206If
207.Fa aux
208contains data set with
209.Xr X509_alias_set1 3 ,
210the raw bytes are printed in unencoded form.
211.It
212If
213.Fa aux
214contains data set with
215.Xr X509_keyid_set1 3 ,
216the bytes are printed in hexadecimal notation with colons in between.
217.El
218.Pp
219.Fn X509_print_ex_fp
220is similar to
221.Fn X509_print_ex
222except that it prints to
223.Fa fp .
224.Pp
225.Fn X509_print
226and
227.Fn X509_print_fp
228are wrapper functions setting the
229.Fa nameflags
230to
231.Dv XN_FLAG_COMPAT
232and the
233.Fa skipflags
234to
235.Dv X509_FLAG_COMPAT .
236.Sh RETURN VALUES
237.Fn X509_print_ex ,
238.Fn X509_print_ex_fp ,
239.Fn X509_print ,
240and
241.Fn X509_print_fp
242return 1 if all requested information was successfully printed,
243even if failures occurred while attempting to decode or print the
244public key or X.509 version 3 extensions, or 0 if any other operation
245failed.
246.Pp
247.Fn X509_CERT_AUX_print
248always 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
257first appeared in SSLeay 0.5.1 and was changed to print to a
258.Vt BIO
259in SSLeay 0.6.0.
260.Fn X509_print_fp
261first appeared in SSLeay 0.6.0.
262Both functions have been available since
263.Ox 2.4 .
264.Pp
265.Fn X509_CERT_AUX_print
266first appeared in OpenSSL 0.9.5 and has been available since
267.Ox 2.7 .
268.Pp
269.Fn X509_print_ex
270and
271.Fn X509_print_ex_fp
272first appeared in OpenSSL 0.9.7 and have been available since
273.Ox 3.2 .
274.Sh BUGS
275If arbitrary data was stored into
276.Fa x
277using
278.Xr X509_alias_set1 3 ,
279these functions may print binary data and even NUL bytes.