summaryrefslogtreecommitdiff
path: root/smcc/src/main/java/at
diff options
context:
space:
mode:
authorBonato, Martin <martin.bonato@prime-sign.com>2018-02-08 22:19:55 +0100
committerBonato, Martin <martin.bonato@prime-sign.com>2018-02-08 22:19:55 +0100
commitb9ccb62d35a755efb505d426ce924d5a8fbe937a (patch)
tree00d17aa7dc660eb0e90ae753e36a623d672fc0e0 /smcc/src/main/java/at
parent84794c877062fe0424f357be0e83bdd045d75d52 (diff)
downloadmocca-b9ccb62d35a755efb505d426ce924d5a8fbe937a.tar.gz
mocca-b9ccb62d35a755efb505d426ce924d5a8fbe937a.tar.bz2
mocca-b9ccb62d35a755efb505d426ce924d5a8fbe937a.zip
BulkSignature implementationfb-bulksignature
Diffstat (limited to 'smcc/src/main/java/at')
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/BulkSignException.java47
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/pin/gui/OverrulePinpadPINGUI.java7
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/pin/gui/PINProvider.java4
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java10
4 files changed, 67 insertions, 1 deletions
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/BulkSignException.java b/smcc/src/main/java/at/gv/egiz/smcc/BulkSignException.java
new file mode 100644
index 00000000..6acfd6c9
--- /dev/null
+++ b/smcc/src/main/java/at/gv/egiz/smcc/BulkSignException.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2015 Datentechnik Innovation GmbH and Prime Sign GmbH, Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+
+/**
+ * @author szoescher szoescher
+ */
+package at.gv.egiz.smcc;
+
+public class BulkSignException extends SignatureCardException {
+
+ private static final long serialVersionUID = 1L;
+
+ public BulkSignException() {
+ super();
+ }
+
+ public BulkSignException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public BulkSignException(String message) {
+ super(message);
+ }
+
+ public BulkSignException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/pin/gui/OverrulePinpadPINGUI.java b/smcc/src/main/java/at/gv/egiz/smcc/pin/gui/OverrulePinpadPINGUI.java
new file mode 100644
index 00000000..3cfc7d98
--- /dev/null
+++ b/smcc/src/main/java/at/gv/egiz/smcc/pin/gui/OverrulePinpadPINGUI.java
@@ -0,0 +1,7 @@
+package at.gv.egiz.smcc.pin.gui;
+
+public interface OverrulePinpadPINGUI extends PINGUI {
+
+ boolean allowOverrulePinpad() throws InterruptedException;
+
+}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/pin/gui/PINProvider.java b/smcc/src/main/java/at/gv/egiz/smcc/pin/gui/PINProvider.java
index b740c0ad..4e7d72f2 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/pin/gui/PINProvider.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/pin/gui/PINProvider.java
@@ -24,6 +24,7 @@
package at.gv.egiz.smcc.pin.gui;
+import at.gv.egiz.smcc.BulkSignException;
import at.gv.egiz.smcc.CancelledException;
import at.gv.egiz.smcc.PinInfo;
@@ -52,8 +53,9 @@ public interface PINProvider {
* @return pin != null
* @throws at.gv.egiz.smcc.CancelledException
* @throws java.lang.InterruptedException
+ * @throws BulkSignException
*/
char[] providePIN(PinInfo pinSpec, int retries)
- throws CancelledException, InterruptedException;
+ throws CancelledException, InterruptedException, BulkSignException;
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java b/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java
index 48331278..45b70ca6 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java
@@ -49,6 +49,7 @@ import at.gv.egiz.smcc.SignatureCardException;
import at.gv.egiz.smcc.TimeoutException;
import at.gv.egiz.smcc.VerifyAPDUSpec;
import at.gv.egiz.smcc.pin.gui.ModifyPINGUI;
+import at.gv.egiz.smcc.pin.gui.OverrulePinpadPINGUI;
import at.gv.egiz.smcc.pin.gui.PINGUI;
import at.gv.egiz.smcc.util.SMCCHelper;
@@ -597,6 +598,15 @@ public class PinpadCardReader extends DefaultCardReader {
byte[] s = createPINVerifyStructure(apduSpec, pinSpec);
Card icc = channel.getCard();
+ if (pinGUI instanceof OverrulePinpadPINGUI && (VERIFY || VERIFY_DIRECT)) {
+ if (((OverrulePinpadPINGUI) pinGUI).allowOverrulePinpad()) {
+ return super.verify(channel, apduSpec, pinGUI, pinSpec, retries);
+ } else {
+ log.debug("The User prohibited deactivation of the pinPad.");
+ throw new CancelledException();
+ }
+ }
+
if (VERIFY) {
boolean regain = dropExclusive(icc);
try {