diff options
author | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-18 07:19:15 +0000 |
---|---|---|
committer | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-18 07:19:15 +0000 |
commit | ac3296bb205048da5a1e4494dd4956f4312cf948 (patch) | |
tree | 4bc1805ab329c8724a956a4c10a1ae564efdce0b /spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java | |
parent | c09f1913c1ac92c76b1baaba705d09c52eeec7db (diff) | |
download | moa-id-spss-ac3296bb205048da5a1e4494dd4956f4312cf948.tar.gz moa-id-spss-ac3296bb205048da5a1e4494dd4956f4312cf948.tar.bz2 moa-id-spss-ac3296bb205048da5a1e4494dd4956f4312cf948.zip |
Fix für Bug 267 getestet.tags/Build-ID-1.2.0.D10
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@382 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java')
-rw-r--r-- | spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java index e8b2a5e10..1f9d45ed1 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java @@ -20,6 +20,7 @@ import iaik.x509.X509Certificate; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; @@ -241,6 +242,8 @@ public class XMLSignatureVerificationInvoker { private CheckResult validateSignerCertificate(XMLSignatureVerificationResult result, TrustProfile trustProfile) throws MOAException { + MessageProvider msg = MessageProvider.getInstance(); + int resultCode = result.getCertificateValidationResult().getValidationResultCode().intValue(); if (resultCode == 0 && trustProfile.getSignerCertsUri() != null) { @@ -275,14 +278,21 @@ public class XMLSignatureVerificationInvoker { try { X509Certificate currentCert = new X509Certificate(currentFIS); + currentFIS.close(); if (currentCert.equals(signerCertificate)) break; } catch (Exception e) { // Simply ignore file if it cannot be interpreted as certificate - Logger.warn("Signatorzertifiat aus Trustprofile mit id=" + - trustProfile.getId() + " kann nicht geparst werden: " + - e.getMessage()); + String logMsg = msg.getMessage("invoker.03", new Object[]{trustProfile.getId(), files[i].getName()}); + Logger.warn(logMsg); + try + { + currentFIS.close(); + } + catch (IOException e1) { + // If clean-up fails, do nothing + } } } } |