Java Code Examples for org.jasypt.properties.PropertyValueEncryptionUtils#isEncryptedValue()

The following examples show how to use org.jasypt.properties.PropertyValueEncryptionUtils#isEncryptedValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EncryptableServletContextPropertyPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 2
Source File: EncryptablePropertyPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 3
Source File: EncryptablePreferencesPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 4
Source File: EncryptableServletContextPropertyPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 5
Source File: EncryptablePreferencesPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 6
Source File: EncryptablePropertySourcesPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 7
Source File: EncryptablePropertyPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 8
Source File: EncryptablePropertyOverrideConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 9
Source File: EncryptablePreferencesPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 10
Source File: EncryptablePropertyPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 11
Source File: EncryptablePropertyOverrideConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 12
Source File: EncryptableServletContextPropertyPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 13
Source File: EncryptablePreferencesPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 14
Source File: EncryptablePropertyPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 15
Source File: EncryptablePropertyOverrideConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 16
Source File: EncryptablePreferencesPlaceholderConfigurer.java    From jasypt with Apache License 2.0 5 votes vote down vote up
protected String convertPropertyValue(final String originalValue) {
	if (!PropertyValueEncryptionUtils.isEncryptedValue(originalValue)) {
		return originalValue;
	}
	if (this.stringEncryptor != null) {
		return PropertyValueEncryptionUtils.decrypt(originalValue,
				this.stringEncryptor);

	}
	return PropertyValueEncryptionUtils.decrypt(originalValue, this.textEncryptor);
}
 
Example 17
Source File: EncryptedPasswordC3P0ConnectionProvider.java    From jasypt with Apache License 2.0 4 votes vote down vote up
public void configure(final Properties props) {
   
   final String encryptorRegisteredName = 
       props.getProperty(ParameterNaming.ENCRYPTOR_REGISTERED_NAME);
   
   final HibernatePBEEncryptorRegistry encryptorRegistry =
       HibernatePBEEncryptorRegistry.getInstance();
   final PBEStringEncryptor encryptor = 
       encryptorRegistry.getPBEStringEncryptor(encryptorRegisteredName);
   
   if (encryptor == null) {
       throw new EncryptionInitializationException(
               "No string encryptor registered for hibernate " +
               "with name \"" + encryptorRegisteredName + "\"");
   }

   // Get the original values, which may be encrypted
   final String driver = props.getProperty(Environment.DRIVER);
   final String url = props.getProperty(Environment.URL);
   final String user = props.getProperty(Environment.USER);
   final String password = props.getProperty(Environment.PASS);

   // Perform decryption operations as needed and store the new values
   if (PropertyValueEncryptionUtils.isEncryptedValue(driver)) {
       props.setProperty(
               Environment.DRIVER, 
               PropertyValueEncryptionUtils.decrypt(driver, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(url)) {
       props.setProperty(
               Environment.URL, 
               PropertyValueEncryptionUtils.decrypt(url, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(user)) {
       props.setProperty(
               Environment.USER, 
               PropertyValueEncryptionUtils.decrypt(user, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(password)) {
       props.setProperty(
               Environment.PASS, 
               PropertyValueEncryptionUtils.decrypt(password, encryptor));
   }
   
   // Let Hibernate do the rest
   super.configure(props);
   
}
 
Example 18
Source File: EncryptedPasswordC3P0ConnectionProvider.java    From jasypt with Apache License 2.0 4 votes vote down vote up
public void configure(final Properties props) {
   
   final String encryptorRegisteredName = 
       props.getProperty(ParameterNaming.ENCRYPTOR_REGISTERED_NAME);
   
   final HibernatePBEEncryptorRegistry encryptorRegistry =
       HibernatePBEEncryptorRegistry.getInstance();
   final PBEStringEncryptor encryptor = 
       encryptorRegistry.getPBEStringEncryptor(encryptorRegisteredName);
   
   if (encryptor == null) {
       throw new EncryptionInitializationException(
               "No string encryptor registered for hibernate " +
               "with name \"" + encryptorRegisteredName + "\"");
   }

   // Get the original values, which may be encrypted
   final String driver = props.getProperty(AvailableSettings.DRIVER);
   final String url = props.getProperty(AvailableSettings.URL);
   final String user = props.getProperty(AvailableSettings.USER);
   final String password = props.getProperty(AvailableSettings.PASS);

   // Perform decryption operations as needed and store the new values
   if (PropertyValueEncryptionUtils.isEncryptedValue(driver)) {
       props.setProperty(
               AvailableSettings.DRIVER, 
               PropertyValueEncryptionUtils.decrypt(driver, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(url)) {
       props.setProperty(
               AvailableSettings.URL, 
               PropertyValueEncryptionUtils.decrypt(url, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(user)) {
       props.setProperty(
               AvailableSettings.USER, 
               PropertyValueEncryptionUtils.decrypt(user, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(password)) {
       props.setProperty(
               AvailableSettings.PASS, 
               PropertyValueEncryptionUtils.decrypt(password, encryptor));
   }
   
   // Let Hibernate do the rest
   super.configure(props);
   
}
 
Example 19
Source File: EncryptedPasswordDriverManagerConnectionProvider.java    From jasypt with Apache License 2.0 4 votes vote down vote up
public void configure(final Properties props) {
   
   final String encryptorRegisteredName = 
       props.getProperty(ParameterNaming.ENCRYPTOR_REGISTERED_NAME);
   
   final HibernatePBEEncryptorRegistry encryptorRegistry =
       HibernatePBEEncryptorRegistry.getInstance();
   final PBEStringEncryptor encryptor = 
       encryptorRegistry.getPBEStringEncryptor(encryptorRegisteredName);
   
   if (encryptor == null) {
       throw new EncryptionInitializationException(
               "No string encryptor registered for hibernate " +
               "with name \"" + encryptorRegisteredName + "\"");
   }

   // Get the original values, which may be encrypted
   final String driver = props.getProperty(Environment.DRIVER);
   final String url = props.getProperty(Environment.URL);
   final String user = props.getProperty(Environment.USER);
   final String password = props.getProperty(Environment.PASS);

   // Perform decryption operations as needed and store the new values
   if (PropertyValueEncryptionUtils.isEncryptedValue(driver)) {
       props.setProperty(
               Environment.DRIVER, 
               PropertyValueEncryptionUtils.decrypt(driver, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(url)) {
       props.setProperty(
               Environment.URL, 
               PropertyValueEncryptionUtils.decrypt(url, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(user)) {
       props.setProperty(
               Environment.USER, 
               PropertyValueEncryptionUtils.decrypt(user, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(password)) {
       props.setProperty(
               Environment.PASS, 
               PropertyValueEncryptionUtils.decrypt(password, encryptor));
   }
   
   // Let Hibernate process
   super.configure(props);
   
}
 
Example 20
Source File: EncryptedPasswordC3P0ConnectionProvider.java    From jasypt with Apache License 2.0 4 votes vote down vote up
public void configure(final Properties props) {
   
   final String encryptorRegisteredName = 
       props.getProperty(ParameterNaming.ENCRYPTOR_REGISTERED_NAME);
   
   final HibernatePBEEncryptorRegistry encryptorRegistry =
       HibernatePBEEncryptorRegistry.getInstance();
   final PBEStringEncryptor encryptor = 
       encryptorRegistry.getPBEStringEncryptor(encryptorRegisteredName);
   
   if (encryptor == null) {
       throw new EncryptionInitializationException(
               "No string encryptor registered for hibernate " +
               "with name \"" + encryptorRegisteredName + "\"");
   }

   // Get the original values, which may be encrypted
   final String driver = props.getProperty(AvailableSettings.DRIVER);
   final String url = props.getProperty(AvailableSettings.URL);
   final String user = props.getProperty(AvailableSettings.USER);
   final String password = props.getProperty(AvailableSettings.PASS);

   // Perform decryption operations as needed and store the new values
   if (PropertyValueEncryptionUtils.isEncryptedValue(driver)) {
       props.setProperty(
               AvailableSettings.DRIVER, 
               PropertyValueEncryptionUtils.decrypt(driver, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(url)) {
       props.setProperty(
               AvailableSettings.URL, 
               PropertyValueEncryptionUtils.decrypt(url, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(user)) {
       props.setProperty(
               AvailableSettings.USER, 
               PropertyValueEncryptionUtils.decrypt(user, encryptor));
   }
   if (PropertyValueEncryptionUtils.isEncryptedValue(password)) {
       props.setProperty(
               AvailableSettings.PASS, 
               PropertyValueEncryptionUtils.decrypt(password, encryptor));
   }
   
   // Let Hibernate do the rest
   super.configure(props);
   
}