From c481189ca628995fb1d575f653c7d717d8216183 Mon Sep 17 00:00:00 2001 From: rudolf Date: Fri, 26 Mar 2004 12:48:38 +0000 Subject: =?UTF-8?q?Ausf=C3=BChrliche=20Fehlerauswertung=20im=20Falle=20ein?= =?UTF-8?q?es=20Fehlers=20bei=20der=20Zertifikatspr=C3=BCfung.=20https://l?= =?UTF-8?q?abs.cio.gv.at/bugzilla/show=5Fbug.cgi=3Fid=3D111=20(RSCH)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@103 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../VerifyXMLSignatureResponseValidator.java | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'id.server/src/at') 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); -- cgit v1.2.3