Issue-ID: AAF-997
Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com>
Change-Id: I3dfb64f3fe18bf99d5d0ef603cbaed436e5ad1e0
public Optional<String> asString() {
try {
String decodedString = new String(decoder.decode(value));
- LOGGER.debug("Decoded string: {}", decodedString);
return Optional.of(decodedString);
} catch(RuntimeException e) {
LOGGER.error("Exception occurred during decoding:", e);
try (StringReader stringReader = new StringReader(pem);
PemReader pemReader = new PemReader(stringReader)) {
- LOGGER.debug("Creating pem object from: {}", pem);
return Optional.ofNullable(pemReader.readPemObject());
} catch (DecoderException | IOException e) {
LOGGER.error("Exception occurred during creation of PEM:", e);