Is there a way to validate a file structure with a json file as input?
It should check MF, USIM ADF etc. like in the Etsi/3GPP specifications.
The goal is to validate a file structure against the specs before writing it the the SIM card. Many checks are already in the files like ts_31_102.py e.g.
What exactly do you mean by file structure in this context? In a strict reading of the term, the file structure just means MF/DF/EF and whether its cyclic, transparent or linear-fixed EF.
Such validation would in theory be possible based on the internal knowledge of the various pySim classes representing the 3GPP specifications. However, nobody yet has written code to use it that way.
the saip-tool [as the name implies] checks constraints of the SAIP format as outlined in the SimAlliance/TCA specification, like which ProfileElements can follow each other in which order. It does not check at all the contents of the files. That is a completely different layer.
Where would this layer fit? Is the implementation much work?
I am more a java or golang developer. Python is new to me. So i’m not sure if it will be easy to support you here.
The layering is in the context of how SIM card technology works. The SAIP format basically works at the ISO7816-4 level (describing the filesystem + card operating system commands), while the contents of the files is the 3GPP TS 31.102 level (describing the file contents).
In terms of the pySim codebase, thoes are also completely different parts. pySim.esim.saip on the one hand, and the pySim.filesystem module and the various other modules for ts_31_102, ts_31_103 etc.
It is not something I can describe here in a few minutes, otherwise I’d do it myself. It’ sfor sure multiple full days of work even for someone very familiar with not juts Python but the codebase of pySim.