ASN.1 Made Simple — What is ASN.1?

What is ASN.1
Explore OSS'

Communication protocols describe the sequence, the content, and the encoding of messages exchanged between computers communicating with each other. ASN.1 is a language for describing the content and the encoding of such messages. For example:

Contact ::= SEQUENCE {
name VisibleString,
phone NumericString

So, the above contact named John Smith with a phone number of 987 6543210 might be serialized in binary or text format (ASN.1 Encoding Rules). For example:

                     Basic Encoding Rules (BER)
       30 19  80 0A 4A6F686E20536D697468  81 0B 3938372036353433323130
                     Packed Encoding Rules (PER) 
       0A 4A 6F 68 6E 20 53 6D 69 74 68 0B A9 80 76 54 32 10
                     XML Encoding Rules (XER)    
       <?xml version="1.0" encoding="UTF-8"?> <Contact> 
       <name>John Smith</name> <phone>987 6543210</phone> </Contact> 
                     JSON Encoding Rules (JER)  
       { "name" : "John Smith", "phone" : "987 6543210" }
Download an
ASN.1 Reference Card

ASN.1 is a mature core technology that is widely used in infrastructures that require robust communication. ASN.1 is precise, with explicit instructions on exactly how any given type of information must be represented when transferred. ASN.1 is independent of the programming languages used to implement communications. Whether you prefer to work in C, C++, Java, C#, or even COBOL, you can still transfer information. One end of transfer could be written in Java while the other end is written in C, and they will still be able to exchange information using ASN.1 with its encoding rules.

ASN.1 is also independent of any hardware or operating system you might choose to use. This allows exchange of information whether one end is a cell phone and the other end is a super computer, or anything in between. ASN.1 is flexible, allowing simple easily understood descriptions, yet has the power, for those who need it, to enforce complex constraints in which the type of information in one component of a message could be determined by the value of another component in the message.

So ASN.1 is robust, precise, programming language independent, hardware independent, operating-system independent, flexible, and powerful.