static public void decrypt(Properties props) { StandardPBEStringEncryptor encryptor = createEncryptor(); for (Object k : new ArrayList(props.keySet())) { String key = (String) k; String value = props.getProperty(key); if (PropertyValueEncryptionUtils.isEncryptedValue(value)) { value = PropertyValueEncryptionUtils.decrypt(value, encryptor); props.setProperty(key, value); } } } public static StandardPBEStringEncryptor createEncryptor() {
private void load(final File source, Properties props) throws IOException { FileInputStream in = new FileInputStream(source); try { props.load(in); if (key.isDecrypt()) { try { EncryptionSupport.decrypt(this.props); } catch (NoClassDefFoundError e) { // this Happens whe jasypt is not on the classpath.. key.setDecrypt(false); LOG.info("jasypt is not on the classpath: password decryption disabled."); } } } finally { in.close(); } }
static public void decrypt(Properties props) { StandardPBEStringEncryptor encryptor = createEncryptor(); for (Object k : new ArrayList(props.keySet())) { String key = (String) k; String value = props.getProperty(key); if (PropertyValueEncryptionUtils.isEncryptedValue(value)) { value = PropertyValueEncryptionUtils.decrypt(value, encryptor); props.setProperty(key, value); } } } public static StandardPBEStringEncryptor createEncryptor() {
private void load(final File source, Properties props) throws IOException { FileInputStream in = new FileInputStream(source); try { props.load(in); if (key.isDecrypt()) { try { EncryptionSupport.decrypt(this.props); } catch (NoClassDefFoundError e) { // this Happens whe jasypt is not on the classpath.. key.setDecrypt(false); LOG.info("jasypt is not on the classpath: password decryption disabled."); } } } finally { in.close(); } }
static public void decrypt(Properties props) { StandardPBEStringEncryptor encryptor = createEncryptor(); for (Object k : new ArrayList(props.keySet())) { String key = (String) k; String value = props.getProperty(key); if (PropertyValueEncryptionUtils.isEncryptedValue(value)) { value = PropertyValueEncryptionUtils.decrypt(value, encryptor); props.setProperty(key, value); } } } public static StandardPBEStringEncryptor createEncryptor() {
private void load(final File source, Properties props) throws IOException { FileInputStream in = new FileInputStream(source); try { props.load(in); if (key.isDecrypt()) { try { EncryptionSupport.decrypt(this.props); } catch (NoClassDefFoundError e) { // this Happens whe jasypt is not on the classpath.. key.setDecrypt(false); LOG.info("jasypt is not on the classpath: password decryption disabled."); } } } finally { in.close(); } }