diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2023-03-22 15:19:54 +0100 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2023-03-27 10:37:28 +0200 |
commit | 7b9e24482d5615b0ae87c77fd90989314f4acbe7 (patch) | |
tree | 735bb8be94051a45165e579cf4190d4e44c3e5b6 /pySim-shell.py | |
parent | 61ef1571f998efa42490c6cfdf0e6bb2e606115f (diff) |
pySim-shell: add cardinfo command
It may sometimes be helpful to get a bit of general information about
the card. To sort out problems it sometimes helps to get an idea what
card type and ICCID pySim-shell has in memory.
Change-Id: If31ed17102dc0108e27a5eb0344aabaaf19b19f9
Diffstat (limited to 'pySim-shell.py')
-rwxr-xr-x | pySim-shell.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pySim-shell.py b/pySim-shell.py index ef6a2b1..d09b45a 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -731,6 +731,17 @@ class PySimCommands(CommandSet): else: raise ValueError("error: cannot authenticate, no adm-pin!") + def do_cardinfo(self, opts): + """Display information about the currently inserted card""" + self._cmd.poutput("Card info:") + self._cmd.poutput(" Name: %s" % self._cmd.card.name) + self._cmd.poutput(" ATR: %s" % b2h(self._cmd.card._scc.get_atr())) + self._cmd.poutput(" ICCID: %s" % self._cmd.iccid) + self._cmd.poutput(" Class-Byte: %s" % self._cmd.card._scc.cla_byte) + self._cmd.poutput(" Select-Ctrl: %s" % self._cmd.card._scc.sel_ctrl) + self._cmd.poutput(" AIDs:") + for a in self._cmd.rs.mf.applications: + self._cmd.poutput(" %s" % a) @with_default_category('ISO7816 Commands') class Iso7816Commands(CommandSet): |