diff --git a/framework/src/main/java/javax/smartcardio/CommandAPDU.java b/framework/src/main/java/javax/smartcardio/CommandAPDU.java index fa6ac29..70415c1 100644 --- a/framework/src/main/java/javax/smartcardio/CommandAPDU.java +++ b/framework/src/main/java/javax/smartcardio/CommandAPDU.java @@ -19,6 +19,8 @@ public class CommandAPDU { * @param apduLength */ public CommandAPDU(byte[] apdu, int apduOffset, int apduLength) { + mBytes = Arrays.copyOfRange(apdu, apduOffset, apduLength); + mNc = apduLength; } /** diff --git a/framework/src/main/java/javax/smartcardio/ResponseAPDU.java b/framework/src/main/java/javax/smartcardio/ResponseAPDU.java index a952c42..ad880ca 100644 --- a/framework/src/main/java/javax/smartcardio/ResponseAPDU.java +++ b/framework/src/main/java/javax/smartcardio/ResponseAPDU.java @@ -1,4 +1,34 @@ package javax.smartcardio; +import java.util.Arrays; + public class ResponseAPDU { + private byte[] mBytes; + + public ResponseAPDU(byte[] apdu) { + this.mBytes = apdu.clone(); + } + + public byte[] getBytes() { + return this.mBytes; + } + + public String toString() { + return "ResponseAPDU: " + mBytes.length + " bytes"; + } + + public int hashCode() { + return Arrays.hashCode(mBytes); + } + + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ResponseAPDU)) { + return false; + } + ResponseAPDU other = (ResponseAPDU) obj; + return Arrays.equals(mBytes, other.getBytes()); + } } diff --git a/framework/src/main/java/javax/smartcardio/TerminalFactorySpi.java b/framework/src/main/java/javax/smartcardio/TerminalFactorySpi.java new file mode 100644 index 0000000..9667c45 --- /dev/null +++ b/framework/src/main/java/javax/smartcardio/TerminalFactorySpi.java @@ -0,0 +1,6 @@ +package javax.smartcardio; + +public abstract class TerminalFactorySpi { + protected TerminalFactorySpi() { } + protected abstract CardTerminals engineTerminals(); +}