summaryrefslogtreecommitdiff
path: root/smccTest/src/main/java/at/gv
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-01-11 18:23:36 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-01-11 18:23:36 +0000
commit9a80f54ae4f11e31559198ba6bec14b4cbf0f178 (patch)
tree874eaf3cbc7dfc6506c187ff52bbe4b8b35f4660 /smccTest/src/main/java/at/gv
parent0b27319bd2886fd1b79441d8cc6076b96da9425d (diff)
downloadmocca-9a80f54ae4f11e31559198ba6bec14b4cbf0f178.tar.gz
mocca-9a80f54ae4f11e31559198ba6bec14b4cbf0f178.tar.bz2
mocca-9a80f54ae4f11e31559198ba6bec14b4cbf0f178.zip
establish secure channel
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@883 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smccTest/src/main/java/at/gv')
-rw-r--r--smccTest/src/main/java/at/gv/egiz/smcc/activation/SecureChannel.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/smccTest/src/main/java/at/gv/egiz/smcc/activation/SecureChannel.java b/smccTest/src/main/java/at/gv/egiz/smcc/activation/SecureChannel.java
new file mode 100644
index 00000000..303b1b68
--- /dev/null
+++ b/smccTest/src/main/java/at/gv/egiz/smcc/activation/SecureChannel.java
@@ -0,0 +1,65 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package at.gv.egiz.smcc.activation;
+
+import java.nio.ByteBuffer;
+import javax.crypto.spec.SecretKeySpec;
+import javax.smartcardio.Card;
+import javax.smartcardio.CardChannel;
+import javax.smartcardio.CardException;
+import javax.smartcardio.CommandAPDU;
+import javax.smartcardio.ResponseAPDU;
+
+/**
+ *
+ * @author clemens
+ */
+public class SecureChannel extends CardChannel {
+
+ CardChannel basicChannel;
+
+ SecretKeySpec kenc;
+ SecretKeySpec kmac;
+ byte[] kencssc;
+ byte[] kmacssc;
+
+ public SecureChannel(CardChannel basicChannel,
+ SecretKeySpec kenc, SecretKeySpec kmac,
+ byte[] kencssc, byte[] kmacssc) {
+ this.basicChannel = basicChannel;
+ this.kenc = kenc;
+ this.kmac = kmac;
+ this.kencssc = kencssc;
+ this.kmacssc = kmacssc;
+ }
+
+
+ @Override
+ public Card getCard() {
+ return basicChannel.getCard();
+ }
+
+ @Override
+ public int getChannelNumber() {
+ return basicChannel.getChannelNumber();
+ }
+
+ @Override
+ public ResponseAPDU transmit(CommandAPDU capdu) throws CardException {
+ return basicChannel.transmit(capdu);
+ }
+
+ @Override
+ public int transmit(ByteBuffer bb, ByteBuffer bb1) throws CardException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void close() throws CardException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}