pySim.esim: Allow calling compile_asn1_subdir() with non-DER coddec

this isn't needed for the on-wire format, but can be useful for debug
output in GSER or JER.

Change-Id: I1de4b9506a92d60f582c328a180760332584f9e4
This commit is contained in:
Harald Welte
2024-07-06 11:26:14 +02:00
committed by laforge
parent 200bf6eb8b
commit c0ea149555

View File

@@ -3,7 +3,7 @@ from typing import Optional
from importlib import resources
def compile_asn1_subdir(subdir_name:str):
def compile_asn1_subdir(subdir_name:str, codec='der'):
"""Helper function that compiles ASN.1 syntax from all files within given subdir"""
import asn1tools
asn_txt = ''
@@ -14,7 +14,7 @@ def compile_asn1_subdir(subdir_name:str):
asn_txt += "\n"
#else:
#print(resources.read_text(__name__, 'asn1/rsp.asn'))
return asn1tools.compile_string(asn_txt, codec='der')
return asn1tools.compile_string(asn_txt, codec=codec)
# SGP.22 section 4.1 Activation Code