diff options
Diffstat (limited to 'certService/src/main/java/org/onap/aaf/certservice/certification/PKCS10CertificationRequestFactory.java')
-rw-r--r-- | certService/src/main/java/org/onap/aaf/certservice/certification/PKCS10CertificationRequestFactory.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/PKCS10CertificationRequestFactory.java b/certService/src/main/java/org/onap/aaf/certservice/certification/PKCS10CertificationRequestFactory.java index 8f89de2f..b255b7c2 100644 --- a/certService/src/main/java/org/onap/aaf/certservice/certification/PKCS10CertificationRequestFactory.java +++ b/certService/src/main/java/org/onap/aaf/certservice/certification/PKCS10CertificationRequestFactory.java @@ -21,17 +21,24 @@ package org.onap.aaf.certservice.certification; import org.bouncycastle.pkcs.PKCS10CertificationRequest; +import org.bouncycastle.util.encoders.DecoderException; import org.bouncycastle.util.io.pem.PemObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.Optional; public class PKCS10CertificationRequestFactory { + private static final Logger LOGGER = LoggerFactory.getLogger(PKCS10CertificationRequestFactory.class); + public Optional<PKCS10CertificationRequest> createKCS10CertificationRequest(PemObject pemObject) { try { + LOGGER.debug("Creating certification request from pem object"); return Optional.of(new PKCS10CertificationRequest(pemObject.getContent())); - } catch (IOException e) { + } catch (DecoderException | IOException e) { + LOGGER.error("Exception occurred during creation of certification request:", e); return Optional.empty(); } } |