diff options
author | 2020-02-16 12:56:55 +0000 | |
---|---|---|
committer | 2020-02-16 12:56:55 +0000 | |
commit | bd10fbac3f2369faa7ea83d2f9800b0dbc96933d (patch) | |
tree | 64389747ed07bf5669371b8a5e52a93230371f32 /certService/src/main/java/org/onap/aaf/certservice/certification/PKCS10CertificationRequestFactory.java | |
parent | 8209f7c8dc47546a354978e36b96d3b80b5b55d9 (diff) | |
parent | 1a82cc89e4846e60842cad12516ccf3544fb2051 (diff) |
Merge "Add more logs and handling DecoderException"
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(); } } |