xref: /freebsd/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 (revision 5956d97f4b3204318ceb6aa9c77bd0bc6ea87a41)
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "ASN1_STRING_PRINT_EX 3"
ASN1_STRING_PRINT_EX 3 "2022-07-05" "1.1.1q" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
ASN1_tag2str, ASN1_STRING_print_ex, ASN1_STRING_print_ex_fp, ASN1_STRING_print \- ASN1_STRING output routines
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/asn1.h> \& int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags); int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags); int ASN1_STRING_print(BIO *out, const ASN1_STRING *str); \& const char *ASN1_tag2str(int tag); .Ve
"DESCRIPTION"
Header "DESCRIPTION" These functions output an \s-1ASN1_STRING\s0 structure. \s-1ASN1_STRING\s0 is used to represent all the \s-1ASN1\s0 string types.

\fBASN1_STRING_print_ex() outputs str to out, the format is determined by the options flags. ASN1_STRING_print_ex_fp() is identical except it outputs to fp instead.

\fBASN1_STRING_print() prints str to out but using a different format to \fBASN1_STRING_print_ex(). It replaces unprintable characters (other than \s-1CR, LF\s0) with '.'.

\fBASN1_tag2str() returns a human-readable name of the specified \s-1ASN.1\s0 tag.

"NOTES"
Header "NOTES" \fBASN1_STRING_print() is a deprecated function which should be avoided; use \fBASN1_STRING_print_ex() instead.

Although there are a large number of options frequently \s-1ASN1_STRFLGS_RFC2253\s0 is suitable, or on \s-1UTF8\s0 terminals \s-1ASN1_STRFLGS_RFC2253 &\s0 ~ASN1_STRFLGS_ESC_MSB.

The complete set of supported options for flags is listed below.

Various characters can be escaped. If \s-1ASN1_STRFLGS_ESC_2253\s0 is set the characters determined by \s-1RFC2253\s0 are escaped. If \s-1ASN1_STRFLGS_ESC_CTRL\s0 is set control characters are escaped. If \s-1ASN1_STRFLGS_ESC_MSB\s0 is set characters with the \s-1MSB\s0 set are escaped: this option should not be used if the terminal correctly interprets \s-1UTF8\s0 sequences.

Escaping takes several forms.

If the character being escaped is a 16 bit character then the form \*(L"\eUXXXX\*(R" is used using exactly four characters for the hex representation. If it is 32 bits then \*(L"\eWXXXXXXXX\*(R" is used using eight characters of its hex representation. These forms will only be used if \s-1UTF8\s0 conversion is not set (see below).

Printable characters are normally escaped using the backslash '\e' character. If \fB\s-1ASN1_STRFLGS_ESC_QUOTE\s0 is set then the whole string is instead surrounded by double quote characters: this is arguably more readable than the backslash notation. Other characters use the \*(L"\eXX\*(R" using exactly two characters of the hex representation.

If \s-1ASN1_STRFLGS_UTF8_CONVERT\s0 is set then characters are converted to \s-1UTF8\s0 format first. If the terminal supports the display of \s-1UTF8\s0 sequences then this option will correctly display multi byte characters.

If \s-1ASN1_STRFLGS_IGNORE_TYPE\s0 is set then the string type is not interpreted at all: everything is assumed to be one byte per character. This is primarily for debugging purposes and can result in confusing output in multi character strings.

If \s-1ASN1_STRFLGS_SHOW_TYPE\s0 is set then the string type itself is printed out before its value (for example \*(L"\s-1BMPSTRING\*(R"\s0), this actually uses ASN1_tag2str().

The content of a string instead of being interpreted can be \*(L"dumped\*(R": this just outputs the value of the string using the form #XXXX using hex format for each octet.

If \s-1ASN1_STRFLGS_DUMP_ALL\s0 is set then any type is dumped.

Normally non character string types (such as \s-1OCTET STRING\s0) are assumed to be one byte per character, if \s-1ASN1_STRFLGS_DUMP_UNKNOWN\s0 is set then they will be dumped instead.

When a type is dumped normally just the content octets are printed, if \fB\s-1ASN1_STRFLGS_DUMP_DER\s0 is set then the complete encoding is dumped instead (including tag and length octets).

\fB\s-1ASN1_STRFLGS_RFC2253\s0 includes all the flags required by \s-1RFC2253.\s0 It is equivalent to: \s-1ASN1_STRFLGS_ESC_2253\s0 | \s-1ASN1_STRFLGS_ESC_CTRL\s0 | \s-1ASN1_STRFLGS_ESC_MSB\s0 | \s-1ASN1_STRFLGS_UTF8_CONVERT\s0 | \s-1ASN1_STRFLGS_DUMP_UNKNOWN ASN1_STRFLGS_DUMP_DER\s0

"RETURN VALUES"
Header "RETURN VALUES" \fBASN1_STRING_print_ex() and ASN1_STRING_print_ex_fp() return the number of characters written or -1 if an error occurred.

\fBASN1_STRING_print() returns 1 on success or 0 on error.

\fBASN1_tag2str() returns a human-readable name of the specified \s-1ASN.1\s0 tag.

"SEE ALSO"
Header "SEE ALSO" \fBX509_NAME_print_ex\|(3), \fBASN1_tag2str\|(3)
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.

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>.