Home | Trees | Indices | Help |
---|
|
1 # Author: Trevor Perrin 2 # Patch from Google adding getChildBytes() 3 # 4 # See the LICENSE file for legal information regarding use of this file. 5 6 """Class for parsing ASN.1""" 7 from .compat import * 8 from .codec import * 9 10 #Takes a byte array which has a DER TLV field at its head4313 p = Parser(bytes) 14 p.get(1) #skip Type 15 16 #Get Length 17 self.length = self._getASN1Length(p) 18 19 #Get Value 20 self.value = p.getFixBytes(self.length)21 22 #Assuming this is a sequence... 2527 p = Parser(self.value) 28 for x in range(which+1): 29 markIndex = p.index 30 p.get(1) #skip Type 31 length = self._getASN1Length(p) 32 p.getFixBytes(length) 33 return p.bytes[markIndex : p.index]34 35 #Decode the ASN.1 DER length field
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Sep 9 18:39:16 2015 | http://epydoc.sourceforge.net |