mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
pySim.esim.saip: Add ProfileElementOpt{USIM,ISIM} classes
Change-Id: Iebff2e767baa19f272eeddc62d7d5b3a8f665db5
This commit is contained in:
@@ -270,7 +270,9 @@ class ProfileElement:
|
||||
'pinCodes': ProfileElementPin,
|
||||
'telecom': ProfileElementTelecom,
|
||||
'usim': ProfileElementUSIM,
|
||||
'opt-usim': ProfileElementOptUSIM,
|
||||
'isim': ProfileElementISIM,
|
||||
'opt-isim': ProfileElementOptISIM,
|
||||
'akaParameter': ProfileElementAKA,
|
||||
}
|
||||
"""Construct an instance from given raw, DER encoded bytes."""
|
||||
@@ -575,6 +577,19 @@ class ProfileElementUSIM(ProfileElement):
|
||||
f = File('ef-imsi', self.decoded['ef-imsi'])
|
||||
return dec_imsi(b2h(f.stream.getvalue()))
|
||||
|
||||
class ProfileElementOptUSIM(ProfileElement):
|
||||
type = 'opt-usim'
|
||||
|
||||
def __init__(self, decoded: Optional[dict] = None):
|
||||
super().__init__()
|
||||
if decoded:
|
||||
self.decoded = decoded
|
||||
return
|
||||
# provide some reasonable defaults for a MNO-SD
|
||||
self.decoded = OrderedDict()
|
||||
self.decoded['optusim-header'] = { 'mandated': None, 'identification': None}
|
||||
self.decoded['templateID'] = str(oid.ADF_USIMopt_not_by_default_v2)
|
||||
|
||||
class ProfileElementISIM(ProfileElement):
|
||||
type = 'isim'
|
||||
|
||||
@@ -594,6 +609,20 @@ class ProfileElementISIM(ProfileElement):
|
||||
def adf_name(self) -> str:
|
||||
return b2h(self.decoded['adf-isim'][0][1]['dfName'])
|
||||
|
||||
class ProfileElementOptISIM(ProfileElement):
|
||||
type = 'opt-isim'
|
||||
|
||||
def __init__(self, decoded: Optional[dict] = None):
|
||||
super().__init__()
|
||||
if decoded:
|
||||
self.decoded = decoded
|
||||
return
|
||||
# provide some reasonable defaults for a MNO-SD
|
||||
self.decoded = OrderedDict()
|
||||
self.decoded['optisim-header'] = { 'mandated': None, 'identification': None}
|
||||
self.decoded['templateID'] = str(oid.ADF_ISIMopt_not_by_default_v2)
|
||||
|
||||
|
||||
class ProfileElementAKA(ProfileElement):
|
||||
type = 'akaParameter'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user