#!/usr/bin/env python
# coding: utf-8
+# cython: language_level=3
# PyDERASN -- Python ASN.1 DER/BER codec with abstract structures
# Copyright (C) 2017-2020 Sergey Matveev <stargrave@stargrave.org>
#
EOC_LEN = len(EOC)
LENINDEF = b"\x80" # length indefinite mark
LENINDEF_PP_CHAR = "I" if PY2 else "∞"
+NAMEDTUPLE_KWARGS = {} if PY2 else {"module": __name__}
########################################################################
"lenindef",
"ber_encoded",
"bered",
-))
+), **NAMEDTUPLE_KWARGS)
def _pp(
"expl_lenindef",
"lenindef",
"ber_encoded",
-))
+), **NAMEDTUPLE_KWARGS)
class Boolean(Obj):
"expl_lenindef",
"lenindef",
"ber_encoded",
-))
+), **NAMEDTUPLE_KWARGS)
class Integer(Obj):
"ber_encoded",
"tag_constructed",
"defined",
-))
+), **NAMEDTUPLE_KWARGS)
class BitString(Obj):
"ber_encoded",
"tag_constructed",
"defined",
-))
+), **NAMEDTUPLE_KWARGS)
class OctetString(Obj):
"expl_lenindef",
"lenindef",
"ber_encoded",
-))
+), **NAMEDTUPLE_KWARGS)
class Null(Obj):
"lenindef",
"ber_encoded",
"defines",
-))
+), **NAMEDTUPLE_KWARGS)
def pureint(value):
PrintableStringState = namedtuple(
"PrintableStringState",
OctetStringState._fields + ("allowable_chars",),
+ **NAMEDTUPLE_KWARGS
)
asn1_type_name = "VisibleString"
-UTCTimeState = namedtuple("UTCTimeState", OctetStringState._fields + ("ber_raw",))
+UTCTimeState = namedtuple(
+ "UTCTimeState",
+ OctetStringState._fields + ("ber_raw",),
+ **NAMEDTUPLE_KWARGS
+)
class UTCTime(VisibleString):
"expl_lenindef",
"lenindef",
"ber_encoded",
-))
+), **NAMEDTUPLE_KWARGS)
class Choice(Obj):
"lenindef",
"ber_encoded",
"defined",
-))
+), **NAMEDTUPLE_KWARGS)
class Any(Obj):
"expl_lenindef",
"lenindef",
"ber_encoded",
-))
+), **NAMEDTUPLE_KWARGS)
class Sequence(Obj):
"expl_lenindef",
"lenindef",
"ber_encoded",
-))
+), **NAMEDTUPLE_KWARGS)
class SequenceOf(Obj):