From f2011669995eecde5c5e88606dfc9d097efb4b7c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 24 May 2021 23:19:30 +0200 Subject: [PATCH] pySim/commands: Add envelope() method for ENVELOPE command Change-Id: I2b5b6585ecbe00b54919b197428fe09a220757c6 --- pySim/commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pySim/commands.py b/pySim/commands.py index 1fbea16c..76b7cd58 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))