From 730b8bc2de32be13016066a86498ae0181b0ee1e Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 17 Aug 2015 18:22:05 +0200 Subject: final changes for Release MOA-ID 3.0.0 --- .../task/impl/ServicesProtocolPVP2XTask.java | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'id/moa-id-webgui/src/main/java/at/gv/egovernment/moa') diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java index 787cd136d..c55c35da0 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java @@ -104,26 +104,28 @@ public class ServicesProtocolPVP2XTask extends AbstractTaskValidator implements Map newConfigValues = new HashMap(); String certBase64 = input.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE); - String[] splittet = certBase64.split(","); - if (splittet.length > 1) { - newConfigValues.put(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE, - splittet[1]); - log.debug("Extract PVP2X metadata validation certificate from GUI upload and add it to key: {}", MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE); + if (MiscUtil.isNotEmpty(certBase64)) { + String[] splittet = certBase64.split(","); + if (splittet.length > 1) { + newConfigValues.put(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE, + splittet[1]); + log.debug("Extract PVP2X metadata validation certificate from GUI upload and add it to key: {}", MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE); - try { - byte[] certSerialized = null; - if (MiscUtil.isNotEmpty(splittet[1])) { - certSerialized = Base64Utils.decode(splittet[1], true); - X509Certificate cert = new X509Certificate(certSerialized); - newConfigValues.put( - MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE_SUBJECT, - cert.getSubjectDN().getName()); + try { + byte[] certSerialized = null; + if (MiscUtil.isNotEmpty(splittet[1])) { + certSerialized = Base64Utils.decode(splittet[1], true); + X509Certificate cert = new X509Certificate(certSerialized); + newConfigValues.put( + MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE_SUBJECT, + cert.getSubjectDN().getName()); - } + } - } catch (IOException | CertificateException e) { - log.error("PVP2X metadata signing certificate is not parseable.", e); + } catch (IOException | CertificateException e) { + log.error("PVP2X metadata signing certificate is not parseable.", e); + } } } -- cgit v1.2.3