960429-2

The text below is taken from the Internet standard RFC 822:

CHAR = <any ASCII character> ; ( 0-177, 0.-127.)

ALPHA = <any ASCII alphabetic character; (101-132, 65.- 90.)
                                       ; (141-172, 97.-122.)

DIGIT = <any ASCII decimal digit> ; ( 60- 71, 48.- 57.)

How can something similar be specified in ASN.1?

Replies:

Solution 1:

CHAR ::= IA5String (SIZE (1))
ALPHA ::= VisibleString (FROM ( "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z") (SIZE (1))
DIGIT ::= NumericString(FROM ("1" "2" "3" "4" "5" "6" "7" "8" "9" "0") (SIZE (1))

Other string types than VisibleString can also be used.

Solution 2:

CHAR ::= INTEGER ( 0 .. 127)
ALPHA ::= INTEGER (65 .. 90 | 97 .. 122)
DIGIT ::= INTEGER (48 .. 57)

List of exam questions