/** * Gets metadata decoded. * * @return the metadata decoded */ @JsonIgnore public String getMetadataDecoded() { if (EncodingUtils.isBase64(metadata)) { return EncodingUtils.decodeBase64ToString(metadata); } return metadata; } }
/** * Gets signing certificate decoded. * * @return the signing certificate decoded */ @JsonIgnore public String getSigningCertificateDecoded() { if (EncodingUtils.isBase64(signingCertificate)) { return EncodingUtils.decodeBase64ToString(signingCertificate); } return signingCertificate; }
/** * Gets encryption certificate decoded. * * @return the encryption certificate decoded */ @JsonIgnore public String getEncryptionCertificateDecoded() { if (EncodingUtils.isBase64(encryptionCertificate)) { return EncodingUtils.decodeBase64ToString(encryptionCertificate); } return encryptionCertificate; }
/** * Gets base-64 decoded value if needed, or the value itself. * * @return the decoded value */ @JsonIgnore public String getDecodedValue() { if (EncodingUtils.isBase64(value)) { return EncodingUtils.decodeBase64ToString(value); } return value; } }
@Override public Map<String, Object> getConsentableAttributesFrom(final ConsentDecision decision) { try { val result = this.consentCipherExecutor.decode(decision.getAttributes()); if (StringUtils.isBlank(result)) { LOGGER.warn("Unable to decipher attributes from consent decision [{}]", decision.getId()); return new HashMap<>(0); } val names = EncodingUtils.decodeBase64ToString(result); return MAPPER.readValue(names, Map.class); } catch (final Exception e) { throw new IllegalArgumentException("Could not serialize attributes for consent decision"); } }