---
* Generic decoder's scheme and pretty printer
(:py:func:`pyderasn.generic_decoder`) can be used in libraries.
+* Ability to specify :ref:`defines_by_path <defines_by_path_kwarg>`
+ during command line invocation.
.. _release1.4:
above, ``content_info["content"].defined == (id_signedData,
signed_data)``.
+.. _defines_by_path_kwarg:
+
defines_by_path kwarg
_____________________
"--schema",
help="Python path to schema definition to use",
)
+ parser.add_argument(
+ "--defines-by-path",
+ help="Python path to decoder's defines_by_path",
+ )
parser.add_argument(
"DERFile",
type=argparse.FileType("rb"),
pprinter = partial(pprint, big_blobs=True)
else:
schema, pprinter = generic_decoder()
- obj, tail = schema().decode(der)
+ obj, tail = schema().decode(
+ der,
+ defines_by_path=(
+ None if args.defines_by_path is None
+ else obj_by_path(args.defines_by_path)
+ ),
+ )
print(pprinter(obj, oids=oids))
if tail != b"":
print("\nTrailing data: %s" % hexenc(tail))