* </p>
*
* @param params encryption parameters
*/
public JasyptEncryption(Map<String,String> params) {
SimpleStringDigesterConfig config = new SimpleStringDigesterConfig();
for (String key : params.keySet()) {
if (EncryptionService.ALGORITHM.equalsIgnoreCase(key)) {
config.setAlgorithm(params.get(key));
} else if (EncryptionService.ENCODING.equalsIgnoreCase(key)) {
config.setStringOutputType(params.get(key));
} else if ("providerName".equalsIgnoreCase(key)) {
config.setProviderName(params.get(key));
} else if ("saltSizeBytes".equalsIgnoreCase(key)) {
config.setSaltSizeBytes(params.get(key));
} else if ("iterations".equalsIgnoreCase(key)) {
config.setIterations(params.get(key));
} else if ("providerClassName".equalsIgnoreCase(key)) {
config.setProviderClassName(params.get(key));
} else if ("saltGeneratorClassName".equalsIgnoreCase(key)) {
config.setSaltGeneratorClassName(params.get(key));
} else {
throw new IllegalArgumentException("Unsupported encryption parameter: " + key);
}
}
this.passwordEncryptor = new ConfigurablePasswordEncryptor();