summaryrefslogtreecommitdiff
path: root/smccTest/src/main/java
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-02-21 09:15:09 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-02-21 09:15:09 +0000
commit311102051b079f8b36047b6cf2db0fdd5aaf9299 (patch)
tree92291ff872ec0b84730ba2b2bfc159386c4aa0bf /smccTest/src/main/java
parentfc3509a2cf9d9c5bbd06b26746c686f2548d5cf8 (diff)
downloadmocca-311102051b079f8b36047b6cf2db0fdd5aaf9299.tar.gz
mocca-311102051b079f8b36047b6cf2db0fdd5aaf9299.tar.bz2
mocca-311102051b079f8b36047b6cf2db0fdd5aaf9299.zip
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@900 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smccTest/src/main/java')
-rw-r--r--smccTest/src/main/java/at/gv/egiz/smcc/activation/Activation.java39
1 files changed, 31 insertions, 8 deletions
diff --git a/smccTest/src/main/java/at/gv/egiz/smcc/activation/Activation.java b/smccTest/src/main/java/at/gv/egiz/smcc/activation/Activation.java
index 8e618ac7..636a25d3 100644
--- a/smccTest/src/main/java/at/gv/egiz/smcc/activation/Activation.java
+++ b/smccTest/src/main/java/at/gv/egiz/smcc/activation/Activation.java
@@ -304,6 +304,22 @@ public class Activation {
} catch (CodingException ex) {
throw new SignatureCardException("failed to read EF.PuK", ex);
}
+
+
+ System.out.println("SELECT EF.AOD");
+ cmdAPDU = new CommandAPDU(0x00, 0xA4, 0x02, 0x00, new byte[]{(byte) 0x50, (byte) 0x37}, 256);
+ System.out.println(" cmd apdu " + toString(cmdAPDU.getBytes()));
+ resp = channel.transmit(cmdAPDU);
+ System.out.println(" -> " + toString(resp.getBytes()) + "\n");
+
+ System.out.println("READ EF.AOD");
+ cmdAPDU = new CommandAPDU(0x00, 0xb0, 0x00, 0x00, 256);
+ System.out.println(" cmd apdu " + toString(cmdAPDU.getBytes()));
+ resp = channel.transmit(cmdAPDU);
+ System.out.println(" -> " + toString(resp.getBytes()) + "\n");
+
+
+
/*
[a8:82:00:a8:b6:16:83:14:80:04:00:00:00:23:00:79:05:03:d0:40:00:00:17:00:12:01:02:00:
7f:49:
@@ -332,6 +348,7 @@ public class Activation {
CommandAPDU cmdAPDU;
ResponseAPDU resp;
+ //alt. select 2f:02
System.out.println("READ EF.GDO (SFI=02)");
cmdAPDU = new CommandAPDU(0x00, 0xb0, 0x82, 0x00, 256);
System.out.println(" cmd apdu " + toString(cmdAPDU.getBytes()));
@@ -757,16 +774,22 @@ hashres : 4D BF FC AD 67 94 55 F9 7F DD 47 30 C7 74 B1 7D CF B8 B3 74 93 87
}
- for (int i = 0; i < 3; i++) {
- byte[] case2apdu = channel.protectCase2(new byte[] { (byte)0x00, (byte)0x0b, (byte)0x00, (byte)0x00, (byte)0x00 });
+ byte[] case2apdu = channel.protectNoCommandData(new byte[] { (byte)0x00, (byte)0xb0, (byte)0x00, (byte)0x00, (byte)0xdf }, true);
+
+ System.out.println("apdu orig: " + toString(apdu_));
+ System.out.println("apdu test: " + toString(case2apdu));
+
+ if (!Arrays.equals(apdu_, case2apdu)) {
+ System.out.println(" ******************************* test failed ");
+ }
+
+ byte[] case3apdu = channel.protectCommandData(new byte[] { (byte)0x00, (byte)0x10, (byte)0x20, (byte)0x30, (byte)0x04, (byte)0x41, (byte)0x042, (byte)0x43, (byte)0x44 }, false);
+ System.out.println("apdu test: " + toString(case3apdu));
+
+ case3apdu = channel.protectCommandData(new byte[] { (byte)0x00, (byte)0x10, (byte)0x20, (byte)0x30, (byte)0x04, (byte)0x41, (byte)0x042, (byte)0x43, (byte)0x44, (byte)0x80 }, true);
+ System.out.println("apdu test: " + toString(case3apdu));
- System.out.println("apdu orig: " + toString(apdu_));
- System.out.println("apdu test: " + toString(case2apdu));
- if (Arrays.equals(apdu_, case2apdu)) {
- System.out.println(" ******************************* ");
- }
- }
}
public static final byte[] SM_RESP_APDU = new byte[] {