summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_NAME_print_ex.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/X509_NAME_print_ex.3')
-rw-r--r--src/lib/libcrypto/man/X509_NAME_print_ex.3199
1 files changed, 199 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/X509_NAME_print_ex.3 b/src/lib/libcrypto/man/X509_NAME_print_ex.3
new file mode 100644
index 0000000000..ca5fc61e18
--- /dev/null
+++ b/src/lib/libcrypto/man/X509_NAME_print_ex.3
@@ -0,0 +1,199 @@
1.Dd $Mdocdate: November 4 2016 $
2.Dt X509_NAME_PRINT_EX 3
3.Os
4.Sh NAME
5.Nm X509_NAME_print_ex ,
6.Nm X509_NAME_print_ex_fp ,
7.Nm X509_NAME_print ,
8.Nm X509_NAME_oneline
9.Nd X509_NAME printing routines
10.Sh SYNOPSIS
11.In openssl/x509.h
12.Ft int
13.Fo X509_NAME_print_ex
14.Fa "BIO *out"
15.Fa "X509_NAME *nm"
16.Fa "int indent"
17.Fa "unsigned long flags"
18.Fc
19.Ft int
20.Fo X509_NAME_print_ex_fp
21.Fa "FILE *fp"
22.Fa "X509_NAME *nm"
23.Fa "int indent"
24.Fa "unsigned long flags"
25.Fc
26.Ft char *
27.Fo X509_NAME_oneline
28.Fa "X509_NAME *a"
29.Fa "char *buf"
30.Fa "int size"
31.Fc
32.Ft int
33.Fo X509_NAME_print
34.Fa "BIO *bp"
35.Fa "X509_NAME *name"
36.Fa "int obase"
37.Fc
38.Sh DESCRIPTION
39.Fn X509_NAME_print_ex
40prints a human readable version of
41.Fa nm
42to
43.Vt BIO
44.Fa out .
45Each line (for multiline formats) is indented by
46.Fa indent
47spaces.
48The output format can be extensively customised by use of the
49.Fa flags
50parameter.
51.Pp
52.Fn X509_NAME_print_ex_fp
53is identical to
54.Fn X509_NAME_print_ex
55except the output is written to the
56.Vt FILE
57pointer
58.Fa fp .
59.Pp
60.Fn X509_NAME_oneline
61prints an ASCII version of
62.Fa a
63to
64.Fa buf .
65At most
66.Fa size
67bytes will be written.
68If
69.Fa buf
70is
71.Dv NULL ,
72then a buffer is dynamically allocated and returned, otherwise
73.Fa buf
74is returned.
75.Pp
76.Fn X509_NAME_print
77prints out
78.Fa name
79to
80.Fa bp
81indenting each line by
82.Fa obase
83characters.
84Multiple lines are used if the output (including indent) exceeds 80
85characters.
86.Pp
87The functions
88.Fn X509_NAME_oneline
89and
90.Fn X509_NAME_print
91are legacy functions which produce a non standard output form.
92They don't handle multi character fields and have various quirks
93and inconsistencies.
94Their use is strongly discouraged in new applications.
95.Pp
96Although there are a large number of possible flags, for most purposes
97.Dv XN_FLAG_ONELINE ,
98.Dv XN_FLAG_MULTILINE ,
99or
100.Dv XN_FLAG_RFC2253
101will suffice.
102As noted on the
103.Xr ASN1_STRING_print_ex 3
104manual page, for UTF-8 terminals the
105.Dv ASN1_STRFLGS_ESC_MSB
106should be unset: so for example
107.Dv XN_FLAG_ONELINE No & Pf ~ Dv ASN1_STRFLGS_ESC_MSB
108would be used.
109.Pp
110The complete set of the flags supported by
111.Dv X509_NAME_print_ex
112is listed below.
113.Pp
114Several options can be OR'ed together.
115.Pp
116The options
117.Dv XN_FLAG_SEP_COMMA_PLUS ,
118.Dv XN_FLAG_SEP_CPLUS_SPC ,
119.Dv XN_FLAG_SEP_SPLUS_SPC ,
120and
121.Dv XN_FLAG_SEP_MULTILINE
122determine the field separators to use.
123Two distinct separators are used between distinct
124RelativeDistinguishedName components and separate values in the same RDN
125for a multi-valued RDN.
126Multi-valued RDNs are currently very rare so the second separator
127will hardly ever be used.
128.Pp
129.Dv XN_FLAG_SEP_COMMA_PLUS
130uses comma and plus as separators.
131.Dv XN_FLAG_SEP_CPLUS_SPC
132uses comma and plus with spaces:
133this is more readable that plain comma and plus.
134.Dv XN_FLAG_SEP_SPLUS_SPC
135uses spaced semicolon and plus.
136.Dv XN_FLAG_SEP_MULTILINE
137uses spaced newline and plus respectively.
138.Pp
139If
140.Dv XN_FLAG_DN_REV
141is set, the whole DN is printed in reversed order.
142.Pp
143The fields
144.Dv XN_FLAG_FN_SN ,
145.Dv XN_FLAG_FN_LN ,
146.Dv XN_FLAG_FN_OID ,
147and
148.Dv XN_FLAG_FN_NONE
149determine how a field name is displayed.
150It will use the short name (e.g. CN) the long name (e.g. commonName)
151always use OID numerical form (normally OIDs are only used if the
152field name is not recognised) and no field name respectively.
153.Pp
154If
155.Dv XN_FLAG_SPC_EQ
156is set, then spaces will be placed around the
157.Ql =
158character separating field names and values.
159.Pp
160If
161.Dv XN_FLAG_DUMP_UNKNOWN_FIELDS
162is set, then the encoding of unknown fields is printed instead of the
163values.
164.Pp
165If
166.Dv XN_FLAG_FN_ALIGN
167is set, then field names are padded to 20 characters:
168this is only of use for multiline format.
169.Pp
170Additionally, all the options supported by
171.Xr ASN1_STRING_print_ex 3
172can be used to control how each field value is displayed.
173.Pp
174In addition a number options can be set for commonly used formats.
175.Pp
176.Dv XN_FLAG_RFC2253
177sets options which produce an output compatible with RFC2253.
178It is equivalent to
179.Dv ASN1_STRFLGS_RFC2253 | XN_FLAG_SEP_COMMA_PLUS | XN_FLAG_DN_REV |
180.Dv XN_FLAG_FN_SN | XN_FLAG_DUMP_UNKNOWN_FIELDS .
181.Pp
182.Dv XN_FLAG_ONELINE
183is a more readable one line format which is the same as:
184.Dv ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE | XN_FLAG_SEP_CPLUS_SPC |
185.Dv XN_FLAG_SPC_EQ | XN_FLAG_FN_SN .
186.Pp
187.Dv XN_FLAG_MULTILINE
188is a multiline format which is the same as:
189.Dv ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | XN_FLAG_SEP_MULTILINE |
190.Dv XN_FLAG_SPC_EQ | XN_FLAG_FN_LN | XN_FLAG_FN_ALIGN .
191.Pp
192.Dv XN_FLAG_COMPAT
193uses a format identical to
194.Fn X509_NAME_print :
195in fact it calls
196.Fn X509_NAME_print
197internally.
198.Sh SEE ALSO
199.Xr ASN1_STRING_print_ex 3