title: How does [0] and [3] wơrk in ASN1?
body: <p>I'm decoding ASN1 (as used in X.509 for HTTPS certificates). I'm doing pretty well, but there is a thing that I just cannot find and understandable documentation for.</p>
  
  <p>In this <a href="http://lapo.it/asn1js/" rel="nofollow noreferrer">JS ASN1 parser</a> you see a <code>[0]</code> and a <code>[3]</code> under a <code>SEQUENCE</code> element, the first looking like this in data: <code>A0 03 02 01 02 ...</code>. I want to know what this means and how to decode it.</p>
  
  <p>Another example is <a href="https://web.archive.org/web/20170708104847/http://www.jensign.com/JavaScience/GetTBSCert/index.html" rel="nofollow noreferrer">Anatomy of an X.509 v3 Certificate</a>, there is a <code>[0]</code> right after the first two <code>SEQUENCE</code> elements.</p>
  
  <p>What I don't understand is how A0 fits with the scheme where the first 2 bits of the tag byte are a class, the next a primitive/constructed bit and the remaining 5 are supposed to be the tag type. A0 is 10100000 which means that the tag type value would be zero.</p>