aboutsummaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-18 15:45:07 +0000
committerhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-18 15:45:07 +0000
commitc68e8bba2e0ed2b576d1775b082de68beea63216 (patch)
treebdaf040329f55d25604ea475a5bdb803263bd199 /utils.py
parentf5e42ca71b25d4f4182b0067a160f02d1cb1d328 (diff)
Transitioning to new APDU code
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@53 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 7494d9d..1fb7c94 100644
--- a/utils.py
+++ b/utils.py
@@ -248,6 +248,19 @@ class C_APDU(APDU):
buffer.append(chr(self.Le))
return "".join(buffer)
+
+ def case(self):
+ "Return 1, 2, 3 or 4, depending on which ISO case we represent."
+ if self.Lc == 0:
+ if not hasattr(self, "_Le"):
+ return 1
+ else:
+ return 2
+ else:
+ if not hasattr(self, "_Le"):
+ return 3
+ else:
+ return 4
class R_APDU(APDU):
"Class for a response APDU"