mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18: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,
|
||||
'isim': ProfileElementISIM,
|
||||
'opt-isim': ProfileElementOptISIM,
|
||||
# TODO: phonebook
|
||||
# TODO: gsm-access
|
||||
'phonebook': ProfileElementPhonebook,
|
||||
'gsm-access': ProfileElementGsmAccess,
|
||||
# TODO: csim
|
||||
# TODO: opt-csim
|
||||
# TODO: eap
|
||||
# TODO: df-5gs
|
||||
# TODO: df-saip
|
||||
'df-5gs': ProfileElementDf5GS,
|
||||
'df-saip': ProfileElementDfSAIP,
|
||||
}
|
||||
if pe_type in class4petype:
|
||||
return class4petype[pe_type]
|
||||
@@ -517,6 +517,54 @@ class ProfileElementTelecom(FsProfileElement):
|
||||
for fname in ['df-telecom', 'ef-arr']:
|
||||
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:
|
||||
"""Representation of a key-component of a key for a security domain."""
|
||||
|
||||
Reference in New Issue
Block a user