diff options
author | mcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2008-10-30 10:33:29 +0000 |
---|---|---|
committer | mcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2008-10-30 10:33:29 +0000 |
commit | c2ae3db1bc6dcb8ba3eb3461c05e293917c004ca (patch) | |
tree | 78151b3f5364daac73dc305f536fae2aa2998521 /smccSTAL/src | |
parent | 687e55f5dbc25855c42757e3024a3c87126803e7 (diff) | |
download | mocca-c2ae3db1bc6dcb8ba3eb3461c05e293917c004ca.tar.gz mocca-c2ae3db1bc6dcb8ba3eb3461c05e293917c004ca.tar.bz2 mocca-c2ae3db1bc6dcb8ba3eb3461c05e293917c004ca.zip |
Updated SMCC to use exclusive access and to throw exceptions upon locked or not activated cards. Improved locale support in the security layer request and response processing. Fixed issue in STAL which prevented the use of RSA-SHA1 signatures. Added additional parameters to the applet test pages.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@128 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smccSTAL/src')
-rw-r--r-- | smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java | 8 | ||||
-rw-r--r-- | smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java index b48d6d50..cfac8cf5 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java @@ -20,6 +20,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import at.gv.egiz.smcc.CancelledException; +import at.gv.egiz.smcc.LockedException; +import at.gv.egiz.smcc.NotActivatedException; import at.gv.egiz.smcc.PINProvider; import at.gv.egiz.smcc.PINSpec; import at.gv.egiz.smcc.SignatureCard; @@ -100,6 +102,12 @@ public class InfoBoxReadRequestHandler extends AbstractRequestHandler implements stalResp.setInfoboxValue(resp); return stalResp; } + } catch (NotActivatedException e) { + log.info("Citizen card not activated.", e); + return new ErrorResponse(6001); + } catch (LockedException e) { + log.info("Citizen card locked.", e); + return new ErrorResponse(6001); } catch (CancelledException cx) { log.debug("User cancelled request", cx); return new ErrorResponse(6001); diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java index dcd12b02..466ec2a9 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java @@ -32,6 +32,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import at.gv.egiz.smcc.CancelledException; +import at.gv.egiz.smcc.LockedException; +import at.gv.egiz.smcc.NotActivatedException; import at.gv.egiz.smcc.PINProvider; import at.gv.egiz.smcc.PINSpec; import at.gv.egiz.smcc.SignatureCard; @@ -78,7 +80,7 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen String jceName = JCEAlgorithmNames.getJCEHashName(signatureMethod); if (jceName == null) { log.error("Hash algorithm not supported:"); - return new ErrorResponse(1000); + return new ErrorResponse(4006); } MessageDigest md = MessageDigest.getInstance(jceName); md.update(signReq.getSignedInfo()); @@ -90,6 +92,12 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen SignResponse stalResp = new SignResponse(); stalResp.setSignatureValue(resp); return stalResp; + } catch (NotActivatedException e) { + log.info("Citizen card not activated.", e); + return new ErrorResponse(6001); + } catch (LockedException e) { + log.info("Citizen card locked.", e); + return new ErrorResponse(6001); } catch (CancelledException cx) { log.debug("User cancelled request"); return new ErrorResponse(6001); |