ASN.1
From Helpful
| This article/section is a stub — probably a pile of half-sorted notes and assertions some of which may well be wrong, and not verified as a whole. Feel free to add or refine. |
Contents |
Summary
ASN.1 (Abstract Syntax Notation One) describes:
- is typed data structures
- serializations for these data structures (it seems DER and BER are most common(verify))
- DER (Distinguished Encoding Rules) - seems a fairly simple byte coding
- BER (Basic Encoding rules) (very widely defined, so more complex to implement than most others(verify))
- CER (Canonical Encoding Rules)
- PER (Packed Encoding Rules) is more compact than DER, but requires that the receiving end knows the ASN.1 syntax that was used to encode the data
- XER (XML Encoding Rules)
In some ways, ASN.1 and particularly codings like BER are way more bloated than you might want in various simple exchanges, though are are useful when defining platform-independent standards as you do not have to worry about transfer/storage codings yourself. Also, DER is efficient enough for a lot of things.
ASN (and usually the encoding rules) are used in places like SSL, X.509, LDAP, H.323 (VoIP), SNMP, Z39.50, various specific uses (e.g. this one in medicine), and others.
Standards
The ASN.1 is standardized by ISO/IEC and ITU-T, with the syntax itself is specified in ISO/IEC 8824-1 and ITU-T Rec. X.680.
There have been a few updates:
- Originally part of CCITT X.409:1984
- Separated into ITU X.209, then revised into the more current:
- ASN.1:1994, also ISO/IEC 8824-1:1995
- ASN.1:1997, also ISO/IEC 8824-1:1998, ITU-T Rec. X.680 (1997)
- ASN.1:2002, also ISO/IEC 8824-1:2002, ITU-T Rec. X.680 (2002)
When you want all related documents, you'll want to know about:
- ITU-T Rec. X.680, ISO/IEC 8824-1 (Specification of basic notation)
- ITU-T Rec. X.681, ISO/IEC 8824-2 (Information object specification)
- ITU-T Rec. X.682, ISO/IEC 8824-3 (Constraint specification)
- ITU-T Rec. X.683, ISO/IEC 8824-4 (Parameterization of ASN.1 specifications)
- ITU-T Rec. X.690, ISO/IEC 8825-1 (BER, CER, DER)
- ITU-T Rec. X.691, ISO/IEC 8825-2 (PER)
- ITU-T Rec. X.693, ISO/IEC 8825-4 (XER)
- ITU-T Rec. X.694, ISO/IEC 8825-5 (XSD mapping)
- RFC 3641 (GSER)
Other related standards include:
- ITU-T Rec. X.692 (ECN, Encoding Control Notation)
- ITU-T Rec. X.891 (Fast Infoset), for encoding XML structures
- ITU-T Rec. X.892 (Fast Web Services), for encoding SOAP/WDSL
- ITU-T Rec. X.893, to apply security
Notes on data types
| This article/section is a stub — probably a pile of half-sorted notes and assertions some of which may well be wrong, and not verified as a whole. Feel free to add or refine. |
The tag numbers mentioned here enumerate ASN.1 types (Universal Tag), of which there are about 30.
Notes on strings
| This article/section is a stub — probably a pile of half-sorted notes and assertions some of which may well be wrong, and not verified as a whole. Feel free to add or refine. |
String types seem to define both encoding (byte coding unless otherwise mentioned) and allowed character set.
- NumericString (tag 18) - 0-9 and space
- GeneralString (tag 27) - ISO 2375 plus space and delete (encoding?(verify))
- GraphicString (tag 25) -
- VisibleString (tag 26) - Visible characters of IA5 (mostly / subset of ASCII?(verify) also called ISO646String?(verify))
- UniversalString (tag 28) - ISO10646 (Unicode) character set (UCS4?(verify))
- BMPString (tag 30) - (UCS-2 encoded characters from the ISO10646 Basic Multilingual Plane )
- PrintableString (tag 19) - [A-Za-z0-9'()+,-./:=?] and space
- VideotexString / T61String (tag 20) (CCITT Recommendation T.61[2]. Also ITU-T 100 plus ITU-T 101 characters?(verify) )
- TeletexString - See ITU-T T.101 [3]
- UTF8String (tag 12)
See also
General information:
- http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One
- http://www.asn1.org/
- ftp://ftp.rsasecurity.com/pub/pkcs/ascii/layman.asc ('A Layman's Guide to a Subset of ASN.1, BER, and DER')
- http://asn1.elibel.tm.fr/
Standards, reference:
- http://www.itu.int/ITU-T/studygroups/com17/languages/
- http://asn1.elibel.tm.fr/en/standards/index.htm#x690
Unsorted:
Libraries
There are libaries that will turn the syntax into parsers, and/or convert specific data coded in specific encoding rules into data structures (often limited, e.g. to BER, DER and PER)

