diff options
Diffstat (limited to 'src/lib/libcrypto/man/X509_NAME_print_ex.3')
-rw-r--r-- | src/lib/libcrypto/man/X509_NAME_print_ex.3 | 199 |
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 | ||
40 | prints a human readable version of | ||
41 | .Fa nm | ||
42 | to | ||
43 | .Vt BIO | ||
44 | .Fa out . | ||
45 | Each line (for multiline formats) is indented by | ||
46 | .Fa indent | ||
47 | spaces. | ||
48 | The output format can be extensively customised by use of the | ||
49 | .Fa flags | ||
50 | parameter. | ||
51 | .Pp | ||
52 | .Fn X509_NAME_print_ex_fp | ||
53 | is identical to | ||
54 | .Fn X509_NAME_print_ex | ||
55 | except the output is written to the | ||
56 | .Vt FILE | ||
57 | pointer | ||
58 | .Fa fp . | ||
59 | .Pp | ||
60 | .Fn X509_NAME_oneline | ||
61 | prints an ASCII version of | ||
62 | .Fa a | ||
63 | to | ||
64 | .Fa buf . | ||
65 | At most | ||
66 | .Fa size | ||
67 | bytes will be written. | ||
68 | If | ||
69 | .Fa buf | ||
70 | is | ||
71 | .Dv NULL , | ||
72 | then a buffer is dynamically allocated and returned, otherwise | ||
73 | .Fa buf | ||
74 | is returned. | ||
75 | .Pp | ||
76 | .Fn X509_NAME_print | ||
77 | prints out | ||
78 | .Fa name | ||
79 | to | ||
80 | .Fa bp | ||
81 | indenting each line by | ||
82 | .Fa obase | ||
83 | characters. | ||
84 | Multiple lines are used if the output (including indent) exceeds 80 | ||
85 | characters. | ||
86 | .Pp | ||
87 | The functions | ||
88 | .Fn X509_NAME_oneline | ||
89 | and | ||
90 | .Fn X509_NAME_print | ||
91 | are legacy functions which produce a non standard output form. | ||
92 | They don't handle multi character fields and have various quirks | ||
93 | and inconsistencies. | ||
94 | Their use is strongly discouraged in new applications. | ||
95 | .Pp | ||
96 | Although there are a large number of possible flags, for most purposes | ||
97 | .Dv XN_FLAG_ONELINE , | ||
98 | .Dv XN_FLAG_MULTILINE , | ||
99 | or | ||
100 | .Dv XN_FLAG_RFC2253 | ||
101 | will suffice. | ||
102 | As noted on the | ||
103 | .Xr ASN1_STRING_print_ex 3 | ||
104 | manual page, for UTF-8 terminals the | ||
105 | .Dv ASN1_STRFLGS_ESC_MSB | ||
106 | should be unset: so for example | ||
107 | .Dv XN_FLAG_ONELINE No & Pf ~ Dv ASN1_STRFLGS_ESC_MSB | ||
108 | would be used. | ||
109 | .Pp | ||
110 | The complete set of the flags supported by | ||
111 | .Dv X509_NAME_print_ex | ||
112 | is listed below. | ||
113 | .Pp | ||
114 | Several options can be OR'ed together. | ||
115 | .Pp | ||
116 | The options | ||
117 | .Dv XN_FLAG_SEP_COMMA_PLUS , | ||
118 | .Dv XN_FLAG_SEP_CPLUS_SPC , | ||
119 | .Dv XN_FLAG_SEP_SPLUS_SPC , | ||
120 | and | ||
121 | .Dv XN_FLAG_SEP_MULTILINE | ||
122 | determine the field separators to use. | ||
123 | Two distinct separators are used between distinct | ||
124 | RelativeDistinguishedName components and separate values in the same RDN | ||
125 | for a multi-valued RDN. | ||
126 | Multi-valued RDNs are currently very rare so the second separator | ||
127 | will hardly ever be used. | ||
128 | .Pp | ||
129 | .Dv XN_FLAG_SEP_COMMA_PLUS | ||
130 | uses comma and plus as separators. | ||
131 | .Dv XN_FLAG_SEP_CPLUS_SPC | ||
132 | uses comma and plus with spaces: | ||
133 | this is more readable that plain comma and plus. | ||
134 | .Dv XN_FLAG_SEP_SPLUS_SPC | ||
135 | uses spaced semicolon and plus. | ||
136 | .Dv XN_FLAG_SEP_MULTILINE | ||
137 | uses spaced newline and plus respectively. | ||
138 | .Pp | ||
139 | If | ||
140 | .Dv XN_FLAG_DN_REV | ||
141 | is set, the whole DN is printed in reversed order. | ||
142 | .Pp | ||
143 | The fields | ||
144 | .Dv XN_FLAG_FN_SN , | ||
145 | .Dv XN_FLAG_FN_LN , | ||
146 | .Dv XN_FLAG_FN_OID , | ||
147 | and | ||
148 | .Dv XN_FLAG_FN_NONE | ||
149 | determine how a field name is displayed. | ||
150 | It will use the short name (e.g. CN) the long name (e.g. commonName) | ||
151 | always use OID numerical form (normally OIDs are only used if the | ||
152 | field name is not recognised) and no field name respectively. | ||
153 | .Pp | ||
154 | If | ||
155 | .Dv XN_FLAG_SPC_EQ | ||
156 | is set, then spaces will be placed around the | ||
157 | .Ql = | ||
158 | character separating field names and values. | ||
159 | .Pp | ||
160 | If | ||
161 | .Dv XN_FLAG_DUMP_UNKNOWN_FIELDS | ||
162 | is set, then the encoding of unknown fields is printed instead of the | ||
163 | values. | ||
164 | .Pp | ||
165 | If | ||
166 | .Dv XN_FLAG_FN_ALIGN | ||
167 | is set, then field names are padded to 20 characters: | ||
168 | this is only of use for multiline format. | ||
169 | .Pp | ||
170 | Additionally, all the options supported by | ||
171 | .Xr ASN1_STRING_print_ex 3 | ||
172 | can be used to control how each field value is displayed. | ||
173 | .Pp | ||
174 | In addition a number options can be set for commonly used formats. | ||
175 | .Pp | ||
176 | .Dv XN_FLAG_RFC2253 | ||
177 | sets options which produce an output compatible with RFC2253. | ||
178 | It 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 | ||
183 | is 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 | ||
188 | is 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 | ||
193 | uses a format identical to | ||
194 | .Fn X509_NAME_print : | ||
195 | in fact it calls | ||
196 | .Fn X509_NAME_print | ||
197 | internally. | ||
198 | .Sh SEE ALSO | ||
199 | .Xr ASN1_STRING_print_ex 3 | ||