diff options
Diffstat (limited to 'id/moa-id-webgui/src/main/java/at')
-rw-r--r-- | id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java | 34 |
1 files changed, 18 insertions, 16 deletions
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<String, String> newConfigValues = new HashMap<String, String>(); 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); + } } } |