diff options
author | Harald Welte <laforge@osmocom.org> | 2023-06-06 17:21:13 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2023-06-07 11:13:34 +0200 |
commit | b0e0dce80adb61aa45221a6ac45ba0e258fc4275 (patch) | |
tree | 50d3c8651cd1e151e644ff49b5b598e1cbb2ae2b /pySim/commands.py | |
parent | 659781cbe1a4b43cf15d9d4971ffec3946514fa8 (diff) |
ts_102221: Add "resume_uicc" command
We've had a "suspend_uicc" command since commit
ec95053249bc7f9308ca1f659d8ef6ac97a6e393 in 2021, but didn't yet
have the corresponding "resume" pair.
Note that you cannot really execute this in a reasonable way from
within pySim, as it is required to power-cycle the card
between SUSPEND and RESUME, see TS 102 221 Section 11.1.22.3.2
Change-Id: I3322fde74f680e77954e1d3e18a32ef5662759f2
Diffstat (limited to 'pySim/commands.py')
-rw-r--r-- | pySim/commands.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pySim/commands.py b/pySim/commands.py index 6acdb2e..dc0edad 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -631,6 +631,13 @@ class SimCardCommands: resume_token = data[4:] return (negotiated_duration_secs, resume_token, sw) + # ETSI TS 102 221 11.1.22 + def resume_uicc(self, token: str): + """Send SUSPEND UICC (resume) to the card.""" + if len(h2b(token)) != 8: + raise ValueError("Token must be 8 bytes long") + data, sw = self._tp.send_apdu_checksw('8076010008' + token) + def get_data(self, tag: int, cla: int = 0x00): data, sw = self._tp.send_apdu('%02xca%04x00' % (cla, tag)) return (data, sw) |