<s> """<STR_LIT>""" <EOL> from compat import * <EOL> from codec import * <EOL> class ASN1Parser : <EOL> def __init__ ( self , bytes ) : <EOL> p = Parser ( bytes ) <EOL> p . get ( <NUM_LIT:1> ) <EOL> self . length = self . _getASN1Length ( p ) <EOL> self . value = p . getFixBytes ( self . length ) <EOL> def getChild ( self , which ) : <EOL> p = Parser ( self . value ) <EOL> for x in range ( which + <NUM_LIT:1> ) : <EOL> markIndex = p . index <EOL> p . get ( <NUM_LIT:1> ) <EOL> length = self . _getASN1Length ( p ) <EOL> p . getFixBytes ( length ) <EOL> return ASN1Parser ( p . bytes [ markIndex : p . index ] ) <EOL> def _getASN1Length ( self , p ) : <EOL> firstLength = p . get ( <NUM_LIT:1> ) <EOL> if firstLength <= <NUM_LIT> : <EOL> return firstLength <EOL> else : <EOL> lengthLength = firstLength & <NUM_LIT> <EOL> return p . get ( lengthLength ) </s>
