@Override protected String convertBytesToString(final byte[] random) { return EncodingUtils.hexEncode(random); } }
/** * Computes hex encoded digest. * * @param alg Digest algorithm to use * @param data data to be hashed * @return hex encoded hash */ public static String digest(final String alg, final byte[] data) { return EncodingUtils.hexEncode(rawDigest(alg, data)); }
private String serializeSessionValues(final Map<String, Object> attributes) { val blob = serializer.toString(attributes); return EncodingUtils.hexEncode(blob); }
private String serializeSessionValues(final Map<String, Object> attributes) { val blob = serializer.toString(attributes); return EncodingUtils.hexEncode(blob); }
private static void sanitizeAndTransformAttributeNames(final Map<String, Object> attributes, final RegisteredService registeredService) { LOGGER.trace("Sanitizing attribute names in preparation of the final validation response"); val attrs = attributes.keySet().stream() .filter(getSanitizingAttributeNamePredicate()) .map(s -> Pair.of(EncodingUtils.hexEncode(s.getBytes(StandardCharsets.UTF_8)), attributes.get(s))) .collect(Collectors.toSet()); if (!attrs.isEmpty()) { LOGGER.info("Found [{}] attribute(s) that need to be sanitized/encoded.", attrs); attributes.keySet().removeIf(getSanitizingAttributeNamePredicate()); attrs.forEach(p -> { val key = p.getKey(); LOGGER.trace("Sanitized attribute name to be [{}]", key); attributes.put(key, transformAttributeValueIfNecessary(p.getValue())); }); } }