The BER encoding for ASN.1 was defined within ITU specification X.690 along with the Canonical and Distinguished Encoding Rules. A copy of this document along with other useful documents and books on ASN.1 and its encodings can be obtained for free here:
Document | Description |
---|---|
X.690 (07/02) | Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER) |
X.680 (07/02) | Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation |
ASN.1 Complete | A verbose yet truely complete book on ASN.1 and various encoding mechanisms. Easy to read since the author takes almost a conversational tone. |
ASN.1 - Communication between heterogeneous systems | Also a very complete book on ASN.1 and various encoding mechanisms. A little more difficult to read but seems to be much better organized and more exacting. I use both books in conjunction often switching between the two based on my mood :-). Both are most excellent - thanks to both authors for graciously providing their books online. |
BER stands for Basic Encoding Rules. These rules describe how to encode and decode basic data types and composite data structures to and from TLV streams. A TLV hence may be primitive (atomic) or constructed (nested) where the value component contains other TLVs. The T is for the Tag a numeric type identifier, the L is for the length of the data carried in the third V component, the value. Outside of this very trivial introduction there is very little to the encoding. Readers should look at the relatively short specification for referrence regarding the exact encoding for various data types using TLV tuples. The books above also have appendices for the various encodings which are longer than the actual specification yet more explanitory.