aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-modul-citizencard_authentication/src/main
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2017-11-27 15:33:37 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2017-11-27 15:45:37 +0100
commitf6ef9b2e21af5a55b9f2b360de3cff38c56904d6 (patch)
tree71c3e2dcdade53d820655a9b5f1aa1b451278f5f /id/server/modules/moa-id-modul-citizencard_authentication/src/main
parent75c7ab602fe14d56217f268ea80e787a5316288a (diff)
downloadmoa-id-spss-f6ef9b2e21af5a55b9f2b360de3cff38c56904d6.tar.gz
moa-id-spss-f6ef9b2e21af5a55b9f2b360de3cff38c56904d6.tar.bz2
moa-id-spss-f6ef9b2e21af5a55b9f2b360de3cff38c56904d6.zip
add some more escaptions
Diffstat (limited to 'id/server/modules/moa-id-modul-citizencard_authentication/src/main')
-rw-r--r--id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
index c9bc31f6c..faeb0158b 100644
--- a/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
+++ b/id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
@@ -67,7 +67,6 @@ import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException;
import at.gv.egovernment.moa.id.commons.api.exceptions.MOAIDException;
import at.gv.egovernment.moa.id.data.Pair;
import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
-import at.gv.egovernment.moa.id.util.XMLUtil;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Constants;
import at.gv.egovernment.moa.util.DOMUtils;
@@ -1203,9 +1202,13 @@ public class AuthenticationServer extends BaseAuthenticationServer {
public static X509Certificate getCertificateFromXML(Element signedXML) throws CertificateException {
NodeList nList = signedXML.getElementsByTagNameNS(Constants.DSIG_NS_URI, "X509Certificate");
-
- String base64CertString = XMLUtil.getFirstTextValueFromNodeList(nList);
-
+
+ String base64CertString = null;
+ if (nList != null && nList.getLength() != 0) {
+ base64CertString = nList.item(0).getTextContent();
+
+ }
+
if (StringUtils.isEmpty(base64CertString)) {
String msg = "XML does not contain a X509Certificate element.";
Logger.error(msg);