1 17 package org.apache.geronimo.util; 18 19 import java.io.Serializable ; 20 21 28 public class EncryptionManager { 29 private final static String SIMPLE_ENCRYPTION_PREFIX = "{Simple}"; 30 31 35 public static String encrypt(Serializable source) { 36 return SIMPLE_ENCRYPTION_PREFIX +SimpleEncryption.encrypt(source); 37 } 38 39 43 public static Object decrypt(String source) { 44 if(source.startsWith(SIMPLE_ENCRYPTION_PREFIX)) { 45 return SimpleEncryption.decrypt(source.substring(SIMPLE_ENCRYPTION_PREFIX.length())); 46 } 47 return source; 48 } 49 } 50 | Popular Tags |