OpenSSL ASN1_STRING_print_ex(3openssl)
NNNNAAAAMMMMEEEEASN1_STRING_print_ex, ASN1_STRING_print_ex_fp - ASN1_STRING
output routines. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include
int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
int ASN1_STRING_print(BIO *out, ASN1_STRING *str);
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNThese functions output an AAAASSSSNNNN1111_SSSSTTTTRRRRIIIINNNNGGGG structure. AAAASSSSNNNN1111_SSSSTTTTRRRRIIIINNNNGGGG
is used to represent all the ASN1 string types.ASN1_STRING_print_ex() outputs ssssttttrrrr to oooouuuutttt, the format is
determined by the options ffffllllaaaaggggssss. ASN1_STRING_print_ex_fp()
is identical except it outputs to ffffpppp instead.ASN1_STRING_print() prints ssssttttrrrr to oooouuuutttt but using a different
format to ASN1_STRING_print_ex(). It replaces unprintable
characters (other than CR, LF) with '.'. NNNNOOOOTTTTEEEESSSSASN1_STRING_print() is a legacy function which should be
avoided in new applications. Although there are a large number of options frequentlyAAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_RRRRFFFFCCCC2222222255553333 is suitable, or on UTF8 terminals
AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_RRRRFFFFCCCC2222222255553333 &&&& ~~~~AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_EEEESSSSCCCC_MMMMSSSSBBBB.
The complete set of supported options for ffffllllaaaaggggssss is listed below.Various characters can be escaped. If AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_EEEESSSSCCCC_2222222255553333
is set the characters determined by RFC2253 are escaped. IfAAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_EEEESSSSCCCC_CCCCTTTTRRRRLLLL is set control characters are escaped.
If AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_EEEESSSSCCCC_MMMMSSSSBBBB is set characters with the MSB set
are escaped: this option should nnnnooootttt be used if the terminal correctly interprets UTF8 sequences. Escaping takes several forms. If the character being escaped is a 16 bit character then the form "\UXXXX" is used using exactly four characters for the hex representation. If it is 32 bits then "\WXXXXXXXX" is used using eight characters of its hex representation. These forms will only be used if UTF8 conversion is not set (see below).3/Feb/2007 Last change: 0.9.8o 1
OpenSSL ASN1_STRING_print_ex(3openssl)
Printable characters are normally escaped using thebackslash '\' character. If AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_EEEESSSSCCCC_QQQQUUUUOOOOTTTTEEEE 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 "\XX" using exactly two characters of the hex representation.If AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_UUUUTTTTFFFF8888_CCCCOOOONNNNVVVVEEEERRRRTTTT is set then characters are
converted to UTF8 format first. If the terminal supports the display of UTF8 sequences then this option will correctly display multi byte characters.If AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_IIIIGGGGNNNNOOOORRRREEEE_TTTTYYYYPPPPEEEE 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 AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_SSSSHHHHOOOOWWWW_TTTTYYYYPPPPEEEE is set then the string type itself
is printed out before its value (for example "BMPSTRING"),this actually uses ASN1_tag2str().
The content of a string instead of being interpreted can be "dumped": this just outputs the value of the string usingthe form #XXXX using hex format for each octet.
If AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_DDDDUUUUMMMMPPPP_AAAALLLLLLLL is set then any type is dumped.
Normally non character string types (such as OCTET STRING) are assumed to be one byte per character, ifAAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_DDDDUUUUMMMMPPPP_UUUUNNNNKKKKNNNNOOOOWWWWNNNN is set then they will be dumped
instead. When a type is dumped normally just the content octets areprinted, if AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_DDDDUUUUMMMMPPPP_DDDDEEEERRRR is set then the complete
encoding is dumped instead (including tag and length octets).AAAASSSSNNNN1111_SSSSTTTTRRRRFFFFLLLLGGGGSSSS_RRRRFFFFCCCC2222222255553333 includes all the flags required by
RFC2253. It is equivalent to:ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL |
ASN1_STRFLGS_ESC_MSB |
ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN
ASN1_STRFLGS_DUMP_DER
SSSSEEEEEEEE AAAALLLLSSSSOOOOX509_NAME_print_ex(3), ASN1_tag2str(3)
HHHHIIIISSSSTTTTOOOORRRRYYYY TBA3/Feb/2007 Last change: 0.9.8o 2
OpenSSL ASN1_STRING_print_ex(3openssl)
3/Feb/2007 Last change: 0.9.8o 3