/** * Decrypts the provided string. * * @param input * String (UTF-8 encoded) to be decrypted * @return The decrypted version of the input string, or directly the input string if no * encryption key is configured. */ public static String decrypt(String input) { if (encryptionService == null || input == null || !input.startsWith(ENCRYPTION_PREFIX)) { return input; } return encryptionService.decrypt(input.replaceFirst(ENCRYPTION_PREFIX, "")); }
/** * Decrypts the provided string. * * @param input * String (UTF-8 encoded) to be decrypted * @return The decrypted version of the input string, or directly the input string if no * encryption key is configured. */ public static String decrypt(String input) { if (encryptionService == null || input == null || !input.startsWith(ENCRYPTION_PREFIX)) { return input; } return encryptionService.decrypt(input.replaceFirst(ENCRYPTION_PREFIX, "")); }
/** * Decrypts the provided string. * @param input * String (UTF-8 encoded) to be decrypted * @return The decrypted version of the input string. */ public String decrypt(String input) { if (input == null || input.length() == 0) { return input; } byte[] inputBytes = input.getBytes(UTF_8); byte[] outputBytes = decrypt(inputBytes); return new String(outputBytes, UTF_8); }
/** * Decrypts the provided string. * * @param input * String (UTF-8 encoded) to be decrypted * @return The decrypted version of the input string. */ public String decrypt(String input) { if (input == null || input.length() == 0) { return input; } byte[] inputBytes = input.getBytes(UTF_8); byte[] outputBytes = decrypt(inputBytes); return new String(outputBytes, UTF_8); }