aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-05-24 23:19:30 +0200
committerHarald Welte <laforge@osmocom.org>2021-06-13 22:31:05 +0200
commitf2011669995eecde5c5e88606dfc9d097efb4b7c (patch)
tree697a33b6e1df07c80489a6f41c3bc7baa00cda00
parent14105dce993140246e43a5f1d6d81e4693e54cca (diff)
pySim/commands: Add envelope() method for ENVELOPE command
-rw-r--r--pySim/commands.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pySim/commands.py b/pySim/commands.py
index 1fbea16..76b7cd5 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -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))