mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-26 23:38:32 +03:00
pySim.esim.saip: Add subclasses for gsm-access, phonebook, 5gs, saip
Those are all optional ProfileElements related to the USIM NAA. Change-Id: I621cc3d2440babdc11b4b038f16acf418bbc88ad
This commit is contained in:
@@ -296,13 +296,13 @@ class ProfileElement:
|
|||||||
'opt-usim': ProfileElementOptUSIM,
|
'opt-usim': ProfileElementOptUSIM,
|
||||||
'isim': ProfileElementISIM,
|
'isim': ProfileElementISIM,
|
||||||
'opt-isim': ProfileElementOptISIM,
|
'opt-isim': ProfileElementOptISIM,
|
||||||
# TODO: phonebook
|
'phonebook': ProfileElementPhonebook,
|
||||||
# TODO: gsm-access
|
'gsm-access': ProfileElementGsmAccess,
|
||||||
# TODO: csim
|
# TODO: csim
|
||||||
# TODO: opt-csim
|
# TODO: opt-csim
|
||||||
# TODO: eap
|
# TODO: eap
|
||||||
# TODO: df-5gs
|
'df-5gs': ProfileElementDf5GS,
|
||||||
# TODO: df-saip
|
'df-saip': ProfileElementDfSAIP,
|
||||||
}
|
}
|
||||||
if pe_type in class4petype:
|
if pe_type in class4petype:
|
||||||
return class4petype[pe_type]
|
return class4petype[pe_type]
|
||||||
@@ -517,6 +517,54 @@ class ProfileElementTelecom(FsProfileElement):
|
|||||||
for fname in ['df-telecom', 'ef-arr']:
|
for fname in ['df-telecom', 'ef-arr']:
|
||||||
self.decoded[fname] = []
|
self.decoded[fname] = []
|
||||||
|
|
||||||
|
class ProfileElementPhonebook(FsProfileElement):
|
||||||
|
type = 'phonebook'
|
||||||
|
|
||||||
|
def __init__(self, decoded: Optional[dict] = None):
|
||||||
|
super().__init__(decoded)
|
||||||
|
if decoded:
|
||||||
|
return
|
||||||
|
# provide some reasonable defaults
|
||||||
|
self.decoded['templateID'] = str(oid.DF_PHONEBOOK_ADF_USIM)
|
||||||
|
for fname in ['df-phonebook']:
|
||||||
|
self.decoded[fname] = []
|
||||||
|
|
||||||
|
class ProfileElementGsmAccess(FsProfileElement):
|
||||||
|
type = 'gsm-access'
|
||||||
|
|
||||||
|
def __init__(self, decoded: Optional[dict] = None):
|
||||||
|
super().__init__(decoded)
|
||||||
|
if decoded:
|
||||||
|
return
|
||||||
|
# provide some reasonable defaults
|
||||||
|
self.decoded['templateID'] = str(oid.DF_GSM_ACCESS_ADF_USIM)
|
||||||
|
for fname in ['df-gsm-access']:
|
||||||
|
self.decoded[fname] = []
|
||||||
|
|
||||||
|
class ProfileElementDf5GS(FsProfileElement):
|
||||||
|
type = 'df-5gs'
|
||||||
|
|
||||||
|
def __init__(self, decoded: Optional[dict] = None):
|
||||||
|
super().__init__(decoded)
|
||||||
|
if decoded:
|
||||||
|
return
|
||||||
|
# provide some reasonable defaults
|
||||||
|
self.decoded['templateID'] = str(oid.DF_5GS_v3)
|
||||||
|
for fname in ['df-5gs']:
|
||||||
|
self.decoded[fname] = []
|
||||||
|
|
||||||
|
class ProfileElementDfSAIP(FsProfileElement):
|
||||||
|
type = 'df-saip'
|
||||||
|
|
||||||
|
def __init__(self, decoded: Optional[dict] = None):
|
||||||
|
super().__init__(decoded)
|
||||||
|
if decoded:
|
||||||
|
return
|
||||||
|
# provide some reasonable defaults
|
||||||
|
self.decoded['templateID'] = str(oid.DF_SAIP)
|
||||||
|
for fname in ['df-saip']:
|
||||||
|
self.decoded[fname] = []
|
||||||
|
|
||||||
|
|
||||||
class SecurityDomainKeyComponent:
|
class SecurityDomainKeyComponent:
|
||||||
"""Representation of a key-component of a key for a security domain."""
|
"""Representation of a key-component of a key for a security domain."""
|
||||||
|
|||||||
Reference in New Issue
Block a user