diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-11-27 15:33:37 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-11-27 15:33:37 +0100 |
commit | e392f06a8e1920e4404f11f74c8f51795ad590a6 (patch) | |
tree | 74d06da7d89582d1448cbb0a3c0c8d1858318b06 /id/server/modules/moa-id-modul-citizencard_authentication/src | |
parent | 813e08137530dba321db7807bd1bb5a53af80541 (diff) | |
download | moa-id-spss-e392f06a8e1920e4404f11f74c8f51795ad590a6.tar.gz moa-id-spss-e392f06a8e1920e4404f11f74c8f51795ad590a6.tar.bz2 moa-id-spss-e392f06a8e1920e4404f11f74c8f51795ad590a6.zip |
add some more escaptions
Diffstat (limited to 'id/server/modules/moa-id-modul-citizencard_authentication/src')
-rw-r--r-- | id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java | 11 |
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); |