summaryrefslogtreecommitdiff
path: root/smccTest/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'smccTest/src/main/java/at')
-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.");
+ }
+
+}