NAME
ASN1STRINGprintex, ASN1STRINGprintexfp - ASN1STRING output
routines.SYNOPSIS
#include
int ASN1STRINGprintex(BIO *out, ASN1STRING *str, unsigned long flags); int ASN1STRINGprintexfp(FILE *fp, ASN1STRING *str, unsigned long flags); int ASN1STRINGprint(BIO *out, ASN1STRING *str);DESCRIPTION
These functions output an AASSNN11SSTTRRIINNGG structure. AASSNN11SSTTRRIINNGG is used to represent all the ASN1 string types. ASN1STRINGprintex() outputs ssttrr to oouutt, the format is determined by the options ffllaaggss. ASN1STRINGprintexfp() is identical except it outputs to ffpp instead. ASN1STRINGprint() prints ssttrr to oouutt but using a different format to ASN1STRINGprintex(). It replaces unprintable characters (other than CR, LF) with '.'. NNOOTTEESS ASN1STRINGprint() is a legacy function which should be avoided in new applications. Although there are a large number of options frequently AASSNN11SSTTRRFFLLGGSSRRFFCC22225533 is suitable, or on UTF8 terminals AASSNN11SSTTRRFFLLGGSSRRFFCC22225533 && ~~AASSNN11SSTTRRFFLLGGSSEESSCCMMSSBB. The complete set of supported options for ffllaaggss is listed below. Various characters can be escaped. If AASSNN11SSTTRRFFLLGGSSEESSCC22225533 is set the characters determined by RFC2253 are escaped. If AASSNN11SSTTRRFFLLGGSSEESSCCCCTTRRLL is set control characters are escaped. If AASSNN11SSTTRRFFLLGGSSEESSCCMMSSBB is set characters with the MSB set are escaped: this option should nnoott 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 "\WXXXX" is used using exactly four characters for the hex representation. If it is 32 bits then "\UXXXXXXXX" is used using eight characters of its hex representation. These forms will only be used if UTF8 conversion is not set (see below). Printable characters are normally escaped using the backslash '\' character. If AASSNN11SSTTRRFFLLGGSSEESSCCQQUUOOTTEE 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 AASSNN11SSTTRRFFLLGGSSUUTTFF88CCOONNVVEERRTT 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 AASSNN11SSTTRRFFLLGGSSIIGGNNOORREETTYYPPEE 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 AASSNN11SSTTRRFFLLGGSSSSHHOOWWTTYYPPEE is set then the string type itself is printed out before its value (for example "BMPSTRING"), this actually uses ASN1tag2str(). The content of a string instead of being interpreted can be "dumped":this just outputs the value of the string using the form #XXXX using
hex format for each octet. If AASSNN11SSTTRRFFLLGGSSDDUUMMPPAALLLL is set then any type is dumped. Normally non character string types (such as OCTET STRING) are assumed to be one byte per character, if AASSNN11SSTTRRFFLLGGSSDDUUMMPPUUNNKKNNOOWWNN is set then they will be dumped instead. When a type is dumped normally just the content octets are printed, if AASSNN11SSTTRRFFLLGGSSDDUUMMPPDDEERR is set then the complete encoding is dumped instead (including tag and length octets). AASSNN11SSTTRRFFLLGGSSRRFFCC22225533 includes all the flags required by RFC2253. It is equivalent to: ASN1STRFLGSESC2253 | ASN1STRFLGSESCCTRL | ASN1STRFLGSESCMSB | ASN1STRFLGSUTF8CONVERT | ASN1STRFLGSDUMPUNKNOWN ASN1STRFLGSDUMPDERSEE ALSO
X509NAMEprintex(3), ASN1tag2str(3)
HISTORY TBA0.9.7l 2004-11-13 ASN1STRINGprintex(3)