1 package org.kuali.common.util.enc; 2 3 import java.util.Properties; 4 5 public interface EncryptionService { 6 7 /** 8 * Encrypt the text and prefix it with <code>enc--</code>. If the text is already encrypted, do nothing. 9 * 10 * <pre> 11 * foo -> x7UiXya -> enc--x7UiXya 12 * </pre> 13 */ 14 String encrypt(String plainText); 15 16 /** 17 * Remove the <code>enc--</code> prefix and then decrypt it. If the text is not encrypted, do nothing. 18 * 19 * <pre> 20 * enc--x7UiXya -> x7UiXya -> foo 21 * </pre> 22 */ 23 String decrypt(String encryptedText); 24 25 /** 26 * Detect any encrypted property values and decrypt them 27 */ 28 void decrypt(Properties properties); 29 30 /** 31 * Encrypt any property values that are not already encrypted. 32 */ 33 void encrypt(Properties properties); 34 35 }