mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-24 06:18:33 +03:00
pySim-read.py: Enable reading of EF.IMPI from ISIM
IMS private user identity (IMPI) As per TS1.103 version 14.2.0, this EF contains the private user identity of the user. EF.IMPI consist of NAI TLV Data object.The NAI shall be encoded to an octet string according to UTF-8 encoding rules as specified in IETF RFC 3629. Reading of EF.IMPI is achieved by first selecting the ISIM application using its AID. This is followed by selecting EF.IMPI with File ID - 6f02 in ADF.ISIM Change-Id: I8d8e76e3f6b9ca7a0be262fee99cd5a397edbefa
This commit is contained in:
committed by
herlesupreeth
parent
28484d03e3
commit
3f67f9c1d3
@@ -375,6 +375,16 @@ class IsimCard(Card):
|
||||
data, sw = self._scc.update_binary(EF_ISIM_ADF_map['DOMAIN'], rpad(content, bin_size_bytes*2))
|
||||
return sw
|
||||
|
||||
def read_impi(self):
|
||||
(res, sw) = self._scc.read_binary(EF_ISIM_ADF_map['IMPI'])
|
||||
if sw == '9000':
|
||||
# Skip the inital tag value ('80') byte and get length of contents
|
||||
length = int(res[2:4], 16)
|
||||
content = h2s(res[4:4+(length*2)])
|
||||
return (content, sw)
|
||||
else:
|
||||
return (None, sw)
|
||||
|
||||
|
||||
class _MagicSimBase(Card):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user