use of org.apereo.cas.util.cipher.WebflowConversationStateCipherExecutor in project cas by apereo.
the class CasCoreWebflowConfiguration method webflowCipherExecutor.
@Bean
@RefreshScope
public CipherExecutor webflowCipherExecutor() {
final WebflowProperties webflow = casProperties.getWebflow();
final EncryptionRandomizedSigningJwtCryptographyProperties crypto = webflow.getCrypto();
boolean enabled = crypto.isEnabled();
if (!enabled && (StringUtils.isNotBlank(crypto.getEncryption().getKey())) && StringUtils.isNotBlank(crypto.getSigning().getKey())) {
LOGGER.warn("Webflow encryption/signing is not enabled explicitly in the configuration, yet signing/encryption keys " + "are defined for operations. CAS will proceed to enable the webflow encryption/signing functionality.");
enabled = true;
}
if (enabled) {
return new WebflowConversationStateCipherExecutor(crypto.getEncryption().getKey(), crypto.getSigning().getKey(), crypto.getAlg(), crypto.getSigning().getKeySize(), crypto.getEncryption().getKeySize());
}
LOGGER.warn("Webflow encryption/signing is turned off. This " + "MAY NOT be safe in a production environment. Consider using other choices to handle encryption, " + "signing and verification of webflow state.");
return CipherExecutor.noOp();
}
Aggregations