aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa
diff options
context:
space:
mode:
authorrudolf <rudolf@d688527b-c9ab-4aba-bd8d-4036d912da1d>2004-03-26 12:48:38 +0000
committerrudolf <rudolf@d688527b-c9ab-4aba-bd8d-4036d912da1d>2004-03-26 12:48:38 +0000
commitc481189ca628995fb1d575f653c7d717d8216183 (patch)
tree02a83b21ff86fe0b06ac7540a1423762c54a2934 /id.server/src/at/gv/egovernment/moa
parent658ddc1007c023784353ee97cfc21fb886b00979 (diff)
downloadmoa-id-spss-c481189ca628995fb1d575f653c7d717d8216183.tar.gz
moa-id-spss-c481189ca628995fb1d575f653c7d717d8216183.tar.bz2
moa-id-spss-c481189ca628995fb1d575f653c7d717d8216183.zip
Ausführliche Fehlerauswertung im Falle eines Fehlers bei der Zertifikatsprüfung.
https://labs.cio.gv.at/bugzilla/show_bug.cgi?id=111 (RSCH) git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@103 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java24
1 files changed, 19 insertions, 5 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java
index ec8cb7b1a..61a95ffa2 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java
@@ -9,6 +9,7 @@ import iaik.x509.X509Certificate;
import at.gv.egovernment.moa.id.auth.data.IdentityLink;
import at.gv.egovernment.moa.id.auth.data.VerifyXMLSignatureResponse;
+import at.gv.egovernment.moa.id.util.MOAIDMessageProvider;
/**
* This class is used to validate an {@link VerifyXMLSignatureResponse}
@@ -54,11 +55,24 @@ public class VerifyXMLSignatureResponseValidator {
if (verifyXMLSignatureResponse.getSignatureCheckCode() != 0)
throw new ValidateException("validator.06", null);
//TODO MOA-ID enhance error messages (reason why check failed)
- if (verifyXMLSignatureResponse.getCertificateCheckCode() != 0)
- if (whatToCheck.equals(CHECK_IDENTITY_LINK))
- throw new ValidateException("validator.07", null);
- else
- throw new ValidateException("validator.19", null);
+ if (verifyXMLSignatureResponse.getCertificateCheckCode() != 0) {
+ String checkFailedReason ="";
+ if (verifyXMLSignatureResponse.getCertificateCheckCode() == 1)
+ checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.21", null);
+ if (verifyXMLSignatureResponse.getCertificateCheckCode() == 2)
+ checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.22", null);
+ if (verifyXMLSignatureResponse.getCertificateCheckCode() == 3)
+ checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.23", null);
+ if (verifyXMLSignatureResponse.getCertificateCheckCode() == 4)
+ checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.24", null);
+ if (verifyXMLSignatureResponse.getCertificateCheckCode() == 5)
+ checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.25", null);
+
+ if (whatToCheck.equals(CHECK_IDENTITY_LINK))
+ throw new ValidateException("validator.07", new Object[] { checkFailedReason } );
+ else
+ throw new ValidateException("validator.19", new Object[] { checkFailedReason } );
+ }
if (verifyXMLSignatureResponse.isXmlDSIGManigest())
if (verifyXMLSignatureResponse.getXmlDSIGManifestCheckCode() != 0)
throw new ValidateException("validator.08", null);