aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/reader/CardMngr.java
diff options
context:
space:
mode:
authorJ08nY2017-01-22 03:17:36 +0100
committerJ08nY2017-01-22 03:17:36 +0100
commit636306e09a84ac785d2711117640efe914ae020f (patch)
treed626572b2e7601d015eefefe9da6a751a00001b9 /src/cz/crcs/ectester/reader/CardMngr.java
parent2e677ed35520f4c3380461205c548fba28998c40 (diff)
downloadECTester-636306e09a84ac785d2711117640efe914ae020f.tar.gz
ECTester-636306e09a84ac785d2711117640efe914ae020f.tar.zst
ECTester-636306e09a84ac785d2711117640efe914ae020f.zip
reader: Added a Command and Response abstraction
- For easier testing - Command assembles the correct instruction from params in its constructor - Command.send() sends the command and obtains the Response with timing - Response parses the ResponseAPDU in its constructor and provides convenience methods to access its contents/SWs/success /failure/print data: Added more curves
Diffstat (limited to 'src/cz/crcs/ectester/reader/CardMngr.java')
-rw-r--r--src/cz/crcs/ectester/reader/CardMngr.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/cz/crcs/ectester/reader/CardMngr.java b/src/cz/crcs/ectester/reader/CardMngr.java
index 9cdd055..d95b7e5 100644
--- a/src/cz/crcs/ectester/reader/CardMngr.java
+++ b/src/cz/crcs/ectester/reader/CardMngr.java
@@ -255,11 +255,13 @@ public class CardMngr {
public ResponseAPDU sendAPDUSimulator(CommandAPDU apdu) {
System.out.println(">>>>");
+ System.out.println(apdu);
System.out.println(Util.bytesToHex(apdu.getBytes()));
ResponseAPDU response = simulator.transmitCommand(apdu);
byte[] responseBytes = response.getBytes();
+ System.out.println(response);
System.out.println(Util.bytesToHex(responseBytes));
System.out.println("<<<<");
@@ -285,13 +287,4 @@ public class CardMngr {
CommandAPDU commandAPDU = new CommandAPDU(apdu);
return send(commandAPDU);
}
-
- public ResponseAPDU[] send(CommandAPDU... apdus) throws CardException {
- ResponseAPDU[] result = new ResponseAPDU[apdus.length];
- for (int i = 0; i < apdus.length; i++) {
- result[i] = send(apdus[i]);
- }
- return result;
- }
-
}