.... Set up some character translations and predefined strings. \*(-- will
\fBX509_NAME_print_ex_fp() is identical to X509_NAME_print_ex() except the output is written to \s-1FILE\s0 pointer fp.
\fBX509_NAME_oneline() prints an \s-1ASCII\s0 version of a to buf. If buf is \s-1NULL\s0 then a buffer is dynamically allocated and returned, and \fBsize is ignored. Otherwise, at most size bytes will be written, including the ending '\e0', and buf is returned.
\fBX509_NAME_print() prints out name to bp indenting each line by obase characters. Multiple lines are used if the output (including indent) exceeds 80 characters.
Although there are a large number of possible flags for most purposes \fB\s-1XN_FLAG_ONELINE\s0, \s-1XN_FLAG_MULTILINE\s0 or \s-1XN_FLAG_RFC2253\s0 will suffice. As noted on the ASN1_STRING_print_ex\|(3) manual page for \s-1UTF8\s0 terminals the \s-1ASN1_STRFLGS_ESC_MSB\s0 should be unset: so for example \fB\s-1XN_FLAG_ONELINE &\s0 ~ASN1_STRFLGS_ESC_MSB would be used.
The complete set of the flags supported by X509_NAME_print_ex() is listed below.
Several options can be ored together.
The options \s-1XN_FLAG_SEP_COMMA_PLUS\s0, \s-1XN_FLAG_SEP_CPLUS_SPC\s0, \fB\s-1XN_FLAG_SEP_SPLUS_SPC\s0 and \s-1XN_FLAG_SEP_MULTILINE\s0 determine the field separators to use. Two distinct separators are used between distinct RelativeDistinguishedName components and separate values in the same \s-1RDN\s0 for a multi-valued \s-1RDN.\s0 Multi-valued RDNs are currently very rare so the second separator will hardly ever be used.
\fB\s-1XN_FLAG_SEP_COMMA_PLUS\s0 uses comma and plus as separators. \s-1XN_FLAG_SEP_CPLUS_SPC\s0 uses comma and plus with spaces: this is more readable that plain comma and plus. \fB\s-1XN_FLAG_SEP_SPLUS_SPC\s0 uses spaced semicolon and plus. \s-1XN_FLAG_SEP_MULTILINE\s0 uses spaced newline and plus respectively.
If \s-1XN_FLAG_DN_REV\s0 is set the whole \s-1DN\s0 is printed in reversed order.
The fields \s-1XN_FLAG_FN_SN\s0, \s-1XN_FLAG_FN_LN\s0, \s-1XN_FLAG_FN_OID\s0, \fB\s-1XN_FLAG_FN_NONE\s0 determine how a field name is displayed. It will use the short name (e.g. \s-1CN\s0) the long name (e.g. commonName) always use \s-1OID\s0 numerical form (normally OIDs are only used if the field name is not recognised) and no field name respectively.
If \s-1XN_FLAG_SPC_EQ\s0 is set then spaces will be placed around the '=' character separating field names and values.
If \s-1XN_FLAG_DUMP_UNKNOWN_FIELDS\s0 is set then the encoding of unknown fields is printed instead of the values.
If \s-1XN_FLAG_FN_ALIGN\s0 is set then field names are padded to 20 characters: this is only of use for multiline format.
Additionally all the options supported by ASN1_STRING_print_ex() can be used to control how each field value is displayed.
In addition a number options can be set for commonly used formats.
\fB\s-1XN_FLAG_RFC2253\s0 sets options which produce an output compatible with \s-1RFC2253\s0 it is equivalent to: \s-1ASN1_STRFLGS_RFC2253\s0 | \s-1XN_FLAG_SEP_COMMA_PLUS\s0 | \s-1XN_FLAG_DN_REV\s0 | \s-1XN_FLAG_FN_SN\s0 | \s-1XN_FLAG_DUMP_UNKNOWN_FIELDS\s0
\fB\s-1XN_FLAG_ONELINE\s0 is a more readable one line format which is the same as: \s-1ASN1_STRFLGS_RFC2253\s0 | \s-1ASN1_STRFLGS_ESC_QUOTE\s0 | \s-1XN_FLAG_SEP_CPLUS_SPC\s0 | \s-1XN_FLAG_SPC_EQ\s0 | \s-1XN_FLAG_FN_SN\s0
\fB\s-1XN_FLAG_MULTILINE\s0 is a multiline format which is the same as: \s-1ASN1_STRFLGS_ESC_CTRL\s0 | \s-1ASN1_STRFLGS_ESC_MSB\s0 | \s-1XN_FLAG_SEP_MULTILINE\s0 | \s-1XN_FLAG_SPC_EQ\s0 | \s-1XN_FLAG_FN_LN\s0 | \s-1XN_FLAG_FN_ALIGN\s0
\fB\s-1XN_FLAG_COMPAT\s0 uses a format identical to X509_NAME_print(): in fact it calls X509_NAME_print() internally.
\fBX509_NAME_print() returns 1 on success or 0 on error.
\fBX509_NAME_print_ex() and X509_NAME_print_ex_fp() return 1 on success or 0 on error if the \s-1XN_FLAG_COMPAT\s0 is set, which is the same as X509_NAME_print(). Otherwise, it returns -1 on error or other values on success.
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.