Friday, 6 April 2018

Introduction to ASN.1

ASN.1 stands for 'Abstract Syntax Notation.One', It is an interface description language used to define structured information that can be serialized and deserialized in cross-platform way. By using ASN.1, you can describe the information and its structure at high level and encoding of such information. you no need to worry about, how it is represented while transmitting between one ASN.1 application to other ASN.1 application.

For example, below statements define a structure to define person objects
Person ::= SEQUENCE {
 name VisibleString,
 phone NumericString,
 email VisibleString
}


Below statements define a person instance by using above structure.
person1 Person ::= 
{  
    name "Hari Krishna", 
    phone "1234567890",
    email "krishna@abcdef.com"
}

Now you can encode above data using any one of ASN.1 supported encoding schemes like BER, DER, PER, UPER, XML, OER.


When you encode above data using XML encoding, it looks like below.
<?xml version="1.0" encoding="UTF-8"?>
<Person>
  <name>Hari Krishna</name>
  <phone>1234567890</phone>
  <email>krishna@abcdef.com</email>
</Person>

You can experiment with ASN.1 online at ‘http://asn1-playground.oss.com/’.

ASN.1 is mainly used in cryptography. ‘ASN.1’ standard used to define the format of x509 certificates.

Where else ASN.1 standard is used?
a.   Telecommunications
b.   Computer Networking
c.   LDAP
d.   SNMP (Simple Network Management Protocol)
e.   Kerberos etc.,

Why ASN.1?
It is internationally accepted standard for data communication, it is vendor, language and platform independent. At one end, you can implement data transfer using Java, and at other end you can consume the data transfer using other language like C++, C#, python etc.,


How the applications communicate using ASN.1?

As shown in the above figure, ASN.1 applications agreed on specific formatting rules. Once the rules are defined, one ASN.1 application can able to communicate with other ASN.1 application.




Previous                                                 Next                                                 Home

No comments:

Post a Comment