"""Python ASN.1 DER/BER codec with abstract structures
This library allows you to marshal various structures in ASN.1 DER
-format, unmarshal them in BER/CER/DER ones.
+format, unmarshal BER/CER/DER ones.
>>> i = Integer(123)
>>> raw = i.encode()
def colored(what, *args, **kwargs):
return what
-__version__ = "7.4"
+__version__ = "7.5"
__all__ = (
"agg_octet_string",
If you press **d**, then current element will be saved in the
current directory under its decode path name (adding ".0", ".1", etc
suffix if such file already exists). **D** will save it with explicit tag.
+
+ You can also invoke it with ``--browse`` command line argument.
"""
from copy import deepcopy
from os.path import exists as path_exists
[("header", "[TLV]len: "), "%d/%d/%d" % (
pp.tlen, pp.llen, pp.vlen,
)],
+ [("header", "TLVlen: "), "%d" % sum((
+ pp.tlen, pp.llen, pp.vlen,
+ ))],
[("header", "Slice: "), "[%d:%d]" % (
pp.offset, pp.offset + pp.tlen + pp.llen + pp.vlen,
)],
lines.append([" [TLV]len: %d/%d/%d" % (
pp.expl_tlen, pp.expl_llen, pp.expl_vlen,
)])
+ lines.append([" TLVlen: %d" % sum((
+ pp.expl_tlen, pp.expl_llen, pp.expl_vlen,
+ ))])
lines.append([" Slice: [%d:%d]" % (
pp.expl_offset,
pp.expl_offset + pp.expl_tlen + pp.expl_llen + pp.expl_vlen,