PrintableString
Restricted character string type
From Wikipedia, the free encyclopedia
A PrintableString is a restricted character string type in the ASN.1 notation. It is used to describe data that consists only of a specific printable subset of the ASCII character set.
According to the ASN.1 Specification of basic notation,[1] the character set of PrintableString can be expressed as:
| Name | Graphic | ASCII Code (DEC) | ASCII Code (HEX) | Type |
|---|---|---|---|---|
| Latin capital letters | A,B, ... Z | 65 - 90 | 41 - 5A | Letter |
| Latin small letters | a,b, ... z | 97 - 122 | 61 - 7A | Letter |
| Numbers | 0,1, ... 9 | 48 - 57 | 30 - 39 | Number |
| SPACE | (space) | 32 | 20 | Whitespace |
| APOSTROPHE | ' | 39 | 27 | Punctuation |
| LEFT PARENTHESIS | ( | 40 | 28 | Punctuation |
| RIGHT PARENTHESIS | ) | 41 | 29 | Punctuation |
| PLUS SIGN | + | 43 | 2B | Punctuation |
| COMMA | , | 44 | 2C | Punctuation |
| HYPHEN-MINUS | - | 45 | 2D | Punctuation |
| FULL STOP | . | 46 | 2E | Punctuation |
| SOLIDUS | / | 47 | 2F | Punctuation |
| COLON | : | 58 | 3A | Punctuation |
| EQUALS SIGN | = | 61 | 3D | Punctuation |
| QUESTION MARK | ? | 63 | 3F | Punctuation |
The entire character set contains precisely 74 characters. Namely: 52 letters, 10 digits, 1 whitespace and 11 punctuation character. All of these characters, including space, meet the C character classification of "printable character".
Practical limitations
The PrintableString definition does not include the at sign (@) or ampersand (&). Both of these are legal characters in email addresses.
This sometimes causes problems for naive implementers who attempt to put an SMTP email address into an X.509 digital certificate Distinguished Name.
The PrintableString definition does not include asterisk (*) which means it must not be used to represent a wildcard in an X.509 digital certificate Distinguished Name.
Character set
The following table shows the PrintableString character set. Each character is shown with the code point of its Unicode equivalent.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x | NUL | SOH | STX | ETX | EOT | ENQ | ACK | BEL | BS | HT | LF | VT | FF | CR | SO | SI |
| 1x | DLE | DC1 | DC2 | DC3 | DC4 | NAK | SYN | ETB | CAN | EM | SUB | ESC | FS | GS | RS | US |
| 2x | SP | ! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | / |
| 3x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = | > | ? |
| 4x | @ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
| 5x | P | Q | R | S | T | U | V | W | X | Y | Z | [ | \ | ] | ^ | _ |
| 6x | ` | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o |
| 7x | p | q | r | s | t | u | v | w | x | y | z | { | | | } | ~ | DEL |
See also
- The X.690 encoding standard for ASN.1
- IA5String, a superset of PrintableString