Package tlslite :: Package utils :: Module asn1parser :: Class ASN1Parser
[hide private]
[frames] | no frames]

type ASN1Parser

source code


Parser and storage of ASN.1 DER encoded objects.

Instance Methods [hide private]
 
__init__(self, bytes)
Create an object from bytes.
source code
ASN1Parser
getChild(self, which)
Return n-th child assuming that the object is a SEQUENCE.
source code
bytearray
getChildBytes(self, which)
Return raw encoding of n-th child, assume self is a SEQUENCE
source code
Static Methods [hide private]
 
_getASN1Length(p)
Decode the ASN.1 DER length field
source code
Instance Variables [hide private]
int length
length of the value of the tag
bytearray value
literal value of the tag
Method Details [hide private]

__init__(self, bytes)
(Constructor)

source code 

Create an object from bytes.

Parameters:
  • bytes (bytearray) - DER encoded ANS.1 object
Overrides: object.__init__

getChild(self, which)

source code 

Return n-th child assuming that the object is a SEQUENCE.

Parameters:
  • which (int) - ordinal of the child to return
Returns: ASN1Parser
decoded child object

getChildBytes(self, which)

source code 

Return raw encoding of n-th child, assume self is a SEQUENCE

Parameters:
  • which (int) - ordinal of the child to return
Returns: bytearray
raw child object