pySim/commands: Add envelope() method for ENVELOPE command

Change-Id: I2b5b6585ecbe00b54919b197428fe09a220757c6
This commit is contained in:
Harald Welte 2021-05-24 23:19:30 +02:00
parent 14105dce99
commit f201166999
1 changed files with 4 additions and 0 deletions

View File

@ -425,3 +425,7 @@ class SimCardCommands(object):
data, sw = self._tp.send_apdu(self.cla_byte + '2800' + ('%02X' % chv_no) + '08' + fc)
self._chv_process_sw('enable', chv_no, pin_code, sw)
return (data, sw)
def envelope(self, payload:str):
"""Send one ENVELOPE command to the SIM"""
return self._tp.send_apdu_checksw('80c20000%02x%s' % (len(payload)//2, payload))