secConfig = config;
} else {
secConfig = Configuration.getGlobalSecurityConfiguration();
}
EncryptionParameters encParams = new EncryptionParameters();
encParams.setEncryptionCredential(encryptionCredential);
if (encryptionCredential == null) {
encParams.setAlgorithm(secConfig.getAutoGeneratedDataEncryptionKeyAlgorithmURI());
} else {
encParams.setAlgorithm(secConfig.getDataEncryptionAlgorithmURI(encryptionCredential));
KeyInfoGenerator kiGenerator = getKeyInfoGenerator(encryptionCredential, secConfig, keyInfoGenName);
if (kiGenerator != null) {
encParams.setKeyInfoGenerator(kiGenerator);
} else {
log.info("No factory for named KeyInfoGenerator {} was found for credential type{}", keyInfoGenName,
encryptionCredential.getCredentialType().getName());
log.info("No KeyInfo will be generated for EncryptedData");
}