summaryrefslogtreecommitdiff
path: root/smcc/src/test/java
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-11-11 12:16:00 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-11-11 12:16:00 +0000
commite4a47aa9393d74647f4f0c66b54dc4519fed492f (patch)
treedcacbccfc7b4e777854ee6b9b1c74f84f7fc7915 /smcc/src/test/java
parent82c59c9d862d3ee9ad43fdc1509d0b5a61cc107c (diff)
downloadmocca-e4a47aa9393d74647f4f0c66b54dc4519fed492f.tar.gz
mocca-e4a47aa9393d74647f4f0c66b54dc4519fed492f.tar.bz2
mocca-e4a47aa9393d74647f4f0c66b54dc4519fed492f.zip
Interrupt in waitForAction (applet closed)
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@162 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smcc/src/test/java')
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/STARCOSCardTest.java2
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/SWCardTest.java94
2 files changed, 48 insertions, 48 deletions
diff --git a/smcc/src/test/java/at/gv/egiz/smcc/STARCOSCardTest.java b/smcc/src/test/java/at/gv/egiz/smcc/STARCOSCardTest.java
index b921a5d5..13210540 100644
--- a/smcc/src/test/java/at/gv/egiz/smcc/STARCOSCardTest.java
+++ b/smcc/src/test/java/at/gv/egiz/smcc/STARCOSCardTest.java
@@ -37,7 +37,7 @@ public class STARCOSCardTest {
* @throws CardException
* @throws NoSuchAlgorithmException
*/
- public static void main(String[] args) throws CardException, NoSuchAlgorithmException {
+ public static void main(String[] args) throws CardException, NoSuchAlgorithmException, InterruptedException {
SMCCHelper helper = new SMCCHelper();
while (helper.getResultCode() != SMCCHelper.CARD_FOUND) {
diff --git a/smcc/src/test/java/at/gv/egiz/smcc/SWCardTest.java b/smcc/src/test/java/at/gv/egiz/smcc/SWCardTest.java
index 5448fee2..38126a67 100644
--- a/smcc/src/test/java/at/gv/egiz/smcc/SWCardTest.java
+++ b/smcc/src/test/java/at/gv/egiz/smcc/SWCardTest.java
@@ -14,50 +14,50 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package at.gv.egiz.smcc;
-
-import java.math.BigInteger;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import at.gv.egiz.smcc.SignatureCard.KeyboxName;
-
-public class SWCardTest implements PINProvider {
-
- SWCard swCard = new SWCard();
-
- public static void main(String[] args) throws Exception {
-
- SWCardTest swCardTest = new SWCardTest();
- swCardTest.test();
-
- }
-
- public void test() throws SignatureCardException, NoSuchAlgorithmException {
-
- swCard.getCertificate(KeyboxName.CERITIFIED_KEYPAIR);
- swCard.getCertificate(KeyboxName.SECURE_SIGNATURE_KEYPAIR);
-
- BigInteger t = BigInteger.valueOf(System.currentTimeMillis());
-
- MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
- byte[] hash = messageDigest.digest(t.toByteArray());
-
- byte[] signature;
- signature = swCard.createSignature(hash, KeyboxName.CERITIFIED_KEYPAIR, this);
- System.out.println(SignatureCardFactory.toString(signature));
-
- signature = swCard.createSignature(hash, KeyboxName.SECURE_SIGNATURE_KEYPAIR, this);
- System.out.println(SignatureCardFactory.toString(signature));
-
- byte[] infobox = swCard.getInfobox("IdentityLink", this, null);
- System.out.println(SignatureCardFactory.toString(infobox));
-
- }
-
- @Override
- public String providePIN(PINSpec spec, int retries) {
- return "buerger";
- }
-
-}
+package at.gv.egiz.smcc;
+
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+import at.gv.egiz.smcc.SignatureCard.KeyboxName;
+
+public class SWCardTest implements PINProvider {
+
+ SWCard swCard = new SWCard();
+
+ public static void main(String[] args) throws Exception {
+
+ SWCardTest swCardTest = new SWCardTest();
+ swCardTest.test();
+
+ }
+
+ public void test() throws SignatureCardException, NoSuchAlgorithmException, InterruptedException {
+
+ swCard.getCertificate(KeyboxName.CERITIFIED_KEYPAIR);
+ swCard.getCertificate(KeyboxName.SECURE_SIGNATURE_KEYPAIR);
+
+ BigInteger t = BigInteger.valueOf(System.currentTimeMillis());
+
+ MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
+ byte[] hash = messageDigest.digest(t.toByteArray());
+
+ byte[] signature;
+ signature = swCard.createSignature(hash, KeyboxName.CERITIFIED_KEYPAIR, this);
+ System.out.println(SignatureCardFactory.toString(signature));
+
+ signature = swCard.createSignature(hash, KeyboxName.SECURE_SIGNATURE_KEYPAIR, this);
+ System.out.println(SignatureCardFactory.toString(signature));
+
+ byte[] infobox = swCard.getInfobox("IdentityLink", this, null);
+ System.out.println(SignatureCardFactory.toString(infobox));
+
+ }
+
+ @Override
+ public String providePIN(PINSpec spec, int retries) {
+ return "buerger";
+ }
+
+}