final String stringOutputType,
final String stringOutputTypeEnvName,
final String stringOutputTypeSysPropertyName) {
final EnvironmentStringPBEConfig config =
new EnvironmentStringPBEConfig();
if (algorithmEnvName != null) {
config.setAlgorithmEnvName(algorithmEnvName);
}
if (algorithmSysPropertyName != null) {
config.setAlgorithmSysPropertyName(algorithmSysPropertyName);
}
if (algorithm != null) {
config.setAlgorithm(algorithm);
}
if (keyObtentionIterationsEnvName != null) {
config.setKeyObtentionIterationsEnvName(
keyObtentionIterationsEnvName);
}
if (keyObtentionIterationsSysPropertyName != null) {
config.setKeyObtentionIterationsSysPropertyName(
keyObtentionIterationsSysPropertyName);
}
if (keyObtentionIterations != null) {
config.setKeyObtentionIterations(keyObtentionIterations);
}
if (passwordEnvName != null) {
config.setPasswordEnvName(passwordEnvName);
}
if (passwordSysPropertyName != null) {
config.setPasswordSysPropertyName(passwordSysPropertyName);
}
if (password != null) {
config.setPassword(password);
}
if (saltGeneratorClassNameEnvName != null) {
config.setSaltGeneratorClassNameEnvName(
saltGeneratorClassNameEnvName);
}
if (saltGeneratorClassNameSysPropertyName != null) {
config.setSaltGeneratorClassNameSysPropertyName(
saltGeneratorClassNameSysPropertyName);
}
if (saltGeneratorClassName != null) {
config.setSaltGeneratorClassName(saltGeneratorClassName);
}
if (providerNameEnvName != null) {
config.setProviderNameEnvName(providerNameEnvName);
}
if (providerNameSysPropertyName != null) {
config.setProviderNameSysPropertyName(providerNameSysPropertyName);
}
if (providerName != null) {
config.setProviderName(providerName);
}
if (providerClassNameEnvName != null) {
config.setProviderClassNameEnvName(providerClassNameEnvName);
}
if (providerClassNameSysPropertyName != null) {
config.setProviderClassNameSysPropertyName(
providerClassNameSysPropertyName);
}
if (providerClassName != null) {
config.setProviderClassName(providerClassName);
}
if (stringOutputTypeEnvName != null) {
config.setStringOutputTypeEnvName(stringOutputTypeEnvName);
}
if (stringOutputTypeSysPropertyName != null) {
config.setStringOutputTypeSysPropertyName(
stringOutputTypeSysPropertyName);
}
if (stringOutputType != null) {
config.setStringOutputType(stringOutputType);
}
final StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setConfig(config);