Like this article? We recommend
Reading the Full ASN.1 Data Stream
Listing 6 illustrates the program output after processing the ASN.1 data in its entirety.
Listing 6 Complete Processing Cycle
Making the first call to parseAsnElement() ASN element type is SEQUENCE 0x30 ASN element length is 12 Making a recursive call to parseAsnElement() ASN element type is INTEGER 0x2 ASN element length is 2 Integer characters 1a Making a recursive call to parseAsnElement() ASN element type is STRING 0x4 ASN element length is 5 String character HELLO Making a recursive call to parseAsnElement()
Processing starts with the sequence element (tag type 0x30) followed by a recursive call to parse the integer. Next, the string is parsed and then one final recursive call is made. The last call returns because there is no more data.