diff options
Diffstat (limited to 'src/lib/libcrypto/man/ASN1_STRING_print_ex.3')
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_STRING_print_ex.3 | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ASN1_STRING_print_ex.3 b/src/lib/libcrypto/man/ASN1_STRING_print_ex.3 new file mode 100644 index 0000000000..1d6495d199 --- /dev/null +++ b/src/lib/libcrypto/man/ASN1_STRING_print_ex.3 | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | .Dd July 17, 2014 | ||
| 2 | .Dt ASN1_STRING_PRINT_EX 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm ASN1_STRING_print_ex , | ||
| 6 | .Nm ASN1_STRING_print_ex_fp , | ||
| 7 | .Nm ASN1_STRING_print | ||
| 8 | .Nd ASN1_STRING output routines | ||
| 9 | .Sh SYNOPSIS | ||
| 10 | .In openssl/asn1.h | ||
| 11 | .Ft int | ||
| 12 | .Fo ASN1_STRING_print_ex | ||
| 13 | .Fa "BIO *out" | ||
| 14 | .Fa "ASN1_STRING *str" | ||
| 15 | .Fa "unsigned long flags" | ||
| 16 | .Fc | ||
| 17 | .Ft int | ||
| 18 | .Fo ASN1_STRING_print_ex_fp | ||
| 19 | .Fa "FILE *fp" | ||
| 20 | .Fa "ASN1_STRING *str" | ||
| 21 | .Fa "unsigned long flags" | ||
| 22 | .Fc | ||
| 23 | .Ft int | ||
| 24 | .Fo ASN1_STRING_print | ||
| 25 | .Fa "BIO *out" | ||
| 26 | .Fa "ASN1_STRING *str" | ||
| 27 | .Fc | ||
| 28 | .Sh DESCRIPTION | ||
| 29 | These functions output an | ||
| 30 | .Vt ASN1_STRING | ||
| 31 | structure. | ||
| 32 | .Vt ASN1_STRING | ||
| 33 | is used to | ||
| 34 | represent all the ASN1 string types. | ||
| 35 | .Pp | ||
| 36 | .Fn ASN1_STRING_print_ex | ||
| 37 | outputs | ||
| 38 | .Fa str | ||
| 39 | to | ||
| 40 | .Fa out , | ||
| 41 | the format is determined by the options | ||
| 42 | .Fa flags . | ||
| 43 | .Fn ASN1_STRING_print_ex_fp | ||
| 44 | is identical except it outputs to | ||
| 45 | .Fa fp | ||
| 46 | instead. | ||
| 47 | .Pp | ||
| 48 | .Fn ASN1_STRING_print | ||
| 49 | prints | ||
| 50 | .Fa str | ||
| 51 | to | ||
| 52 | .Fa out | ||
| 53 | but using a different format to | ||
| 54 | .Fn ASN1_STRING_print_ex . | ||
| 55 | It replaces unprintable characters (other than CR, LF) with | ||
| 56 | .Sq \&. . | ||
| 57 | .Sh NOTES | ||
| 58 | .Fn ASN1_STRING_print | ||
| 59 | is a legacy function which should be avoided in new | ||
| 60 | applications. | ||
| 61 | .Pp | ||
| 62 | Although there are a large number of options frequently | ||
| 63 | .Dv ASN1_STRFLGS_RFC2253 | ||
| 64 | is suitable, or on UTF8 terminals | ||
| 65 | .Dv ASN1_STRFLGS_RFC2253 No & | ||
| 66 | .Pf ~ Dv ASN1_STRFLGS_ESC_MSB . | ||
| 67 | .Pp | ||
| 68 | The complete set of supported options for | ||
| 69 | .Fa flags | ||
| 70 | is listed below. | ||
| 71 | .Pp | ||
| 72 | Various characters can be escaped. | ||
| 73 | If | ||
| 74 | .Dv ASN1_STRFLGS_ESC_2253 | ||
| 75 | is set, the characters determined by RFC2253 are escaped. | ||
| 76 | If | ||
| 77 | .Dv ASN1_STRFLGS_ESC_CTRL | ||
| 78 | is set, control characters are escaped. | ||
| 79 | If | ||
| 80 | .Dv ASN1_STRFLGS_ESC_MSB | ||
| 81 | is set, characters with the MSB set are escaped: this option should | ||
| 82 | .Em not | ||
| 83 | be used if the terminal correctly interprets UTF8 sequences. | ||
| 84 | .Pp | ||
| 85 | Escaping takes several forms. | ||
| 86 | .Pp | ||
| 87 | If the character being escaped is a 16 bit character then the form "\eUXXXX" | ||
| 88 | is used using exactly four characters for the hex representation. | ||
| 89 | If it is 32 bits then "\eWXXXXXXXX" is used using eight characters | ||
| 90 | of its hex representation. | ||
| 91 | These forms will only be used if UTF8 conversion is not set (see below). | ||
| 92 | .Pp | ||
| 93 | Printable characters are normally escaped using the backslash | ||
| 94 | .Pq Sq \e | ||
| 95 | character. | ||
| 96 | If | ||
| 97 | .Dv ASN1_STRFLGS_ESC_QUOTE | ||
| 98 | is set, then the whole string is instead surrounded by double quote | ||
| 99 | characters: this is arguably more readable than the backslash notation. | ||
| 100 | Other characters use the "\eXX" using exactly two characters of the hex | ||
| 101 | representation. | ||
| 102 | .Pp | ||
| 103 | If | ||
| 104 | .Dv ASN1_STRFLGS_UTF8_CONVERT | ||
| 105 | is set, then characters are converted to UTF8 format first. | ||
| 106 | If the terminal supports the display of UTF8 sequences then this | ||
| 107 | option will correctly display multi byte characters. | ||
| 108 | .Pp | ||
| 109 | If | ||
| 110 | .Dv ASN1_STRFLGS_IGNORE_TYPE | ||
| 111 | is set, then the string type is not interpreted at all: | ||
| 112 | everything is assumed to be one byte per character. | ||
| 113 | This is primarily for debugging purposes and can result | ||
| 114 | in confusing output in multi character strings. | ||
| 115 | .Pp | ||
| 116 | If | ||
| 117 | .Dv ASN1_STRFLGS_SHOW_TYPE | ||
| 118 | is set, then the string type itself is printed out before its value | ||
| 119 | (for example "BMPSTRING"), this actually uses | ||
| 120 | .Fn ASN1_tag2str . | ||
| 121 | .Pp | ||
| 122 | The content of a string instead of being interpreted can be "dumped": | ||
| 123 | this just outputs the value of the string using the form #XXXX | ||
| 124 | using hex format for each octet. | ||
| 125 | .Pp | ||
| 126 | If | ||
| 127 | .Dv ASN1_STRFLGS_DUMP_ALL | ||
| 128 | is set, then any type is dumped. | ||
| 129 | .Pp | ||
| 130 | Normally non character string types (such as OCTET STRING) | ||
| 131 | are assumed to be one byte per character; if | ||
| 132 | .Dv ASN1_STRFLGS_DUMP_UNKNOWN | ||
| 133 | is set, then they will be dumped instead. | ||
| 134 | .Pp | ||
| 135 | When a type is dumped normally just the content octets are printed; if | ||
| 136 | .Dv ASN1_STRFLGS_DUMP_DER | ||
| 137 | is set, then the complete encoding is dumped | ||
| 138 | instead (including tag and length octets). | ||
| 139 | .Pp | ||
| 140 | .Dv ASN1_STRFLGS_RFC2253 | ||
| 141 | includes all the flags required by RFC2253. | ||
| 142 | It is equivalent to | ||
| 143 | .Dv ASN1_STRFLGS_ESC_2253 | | ||
| 144 | .Dv ASN1_STRFLGS_ESC_CTRL | | ||
| 145 | .Dv ASN1_STRFLGS_ESC_MSB | | ||
| 146 | .Dv ASN1_STRFLGS_UTF8_CONVERT | | ||
| 147 | .Dv ASN1_STRFLGS_DUMP_UNKNOWN | | ||
| 148 | .Dv ASN1_STRFLGS_DUMP_DER . | ||
| 149 | .Sh SEE ALSO | ||
| 150 | .Xr ASN1_tag2str 3 , | ||
| 151 | .Xr X509_NAME_print_ex 3 | ||
