path: root/pySim-read.py
diff options
authorSupreeth Herle <herlesupreeth@gmail.com>2020-03-25 15:38:02 +0100
committerherlesupreeth <herlesupreeth@gmail.com>2021-01-05 11:46:41 +0100
commit3f67f9c1d310363678a484918f0e9c93814d202e (patch)
treed9151be13ef16cc66b5137308c402e294ed104ec /pySim-read.py
parent28484d03e31cec11aa47c41bf52edca9d76c47dc (diff)
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
Diffstat (limited to 'pySim-read.py')
1 files changed, 11 insertions, 0 deletions
diff --git a/pySim-read.py b/pySim-read.py
index f63205a..a7d9063 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -315,6 +315,17 @@ if __name__ == '__main__':
except Exception as e:
print("Home Network Domain Name: Can't read file -- " + str(e))
+ # EF.IMPI - IMS private user identity
+ try:
+ if card.file_exists(EF_ISIM_ADF_map['IMPI']):
+ (res, sw) = card.read_impi()
+ if sw == '9000':
+ print("IMS private user identity: %s" % (len(res) and res or 'Not available',))
+ else:
+ print("IMS private user identity: Can't read, response code = %s" % (sw,))
+ except Exception as e:
+ print("IMS private user identity: Can't read file -- " + str(e))
# Check whether we have th AID of ISIM, if so select it by its AID
# EF.IST - File Id in ADF ISIM : 6f07
if '9000' == card.select_adf_by_aid(adf="isim"):