X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=blobdiff_plain;f=pyderasn.py;h=acf0e469260588a921f20d5493546a86955e2a2b;hp=f2ef0d79b62836fb13b18c837f93936f47439085;hb=4d56972efc2c9afe2edb27c4d91bf5c1d5ca4ede;hpb=2911db92545262149dfd796d8434b7b41fd37fc2 diff --git a/pyderasn.py b/pyderasn.py index f2ef0d7..acf0e46 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -251,6 +251,7 @@ done. Following types can be automatically decoded (DEFINED BY): * :py:class:`pyderasn.Any` +* :py:class:`pyderasn.BitString` (that is multiple of 8 bits) * :py:class:`pyderasn.OctetString` * :py:class:`pyderasn.SequenceOf`/:py:class:`pyderasn.SetOf` ``Any``/``OctetString``-s @@ -1681,7 +1682,7 @@ class BitString(Obj): >>> b.specs {'nonRepudiation': 1, 'digitalSignature': 0, 'keyEncipherment': 2} """ - __slots__ = ("specs",) + __slots__ = ("specs", "defined") tag_default = tag_encode(3) asn1_type_name = "BIT STRING" @@ -1718,6 +1719,7 @@ class BitString(Obj): ) if value is None: self._value = default + self.defined = None def _bits2octets(self, bits): if len(self.specs) > 0: @@ -1966,6 +1968,11 @@ class BitString(Obj): expl_llen=self.expl_llen if self.expled else None, expl_vlen=self.expl_vlen if self.expled else None, ) + defined_by, defined = self.defined or (None, None) + if defined_by is not None: + yield defined.pps( + decode_path=decode_path + (decode_path_defby(defined_by),) + ) class OctetString(Obj):