Search in sources :

Example 1 with ProtocolTicketCipherExecutor

use of org.apereo.cas.util.cipher.ProtocolTicketCipherExecutor in project cas by apereo.

the class CasCoreTicketsConfiguration method protocolTicketCipherExecutor.

@RefreshScope
@Bean
@ConditionalOnMissingBean(name = "protocolTicketCipherExecutor")
public CipherExecutor protocolTicketCipherExecutor() {
    final EncryptionJwtSigningJwtCryptographyProperties crypto = casProperties.getTicket().getCrypto();
    if (crypto.isEnabled()) {
        return new ProtocolTicketCipherExecutor(crypto.getEncryption().getKey(), crypto.getSigning().getKey(), crypto.getAlg());
    }
    LOGGER.debug("Protocol tickets generated by CAS are not signed/encrypted.");
    return CipherExecutor.noOp();
}
Also used : ProtocolTicketCipherExecutor(org.apereo.cas.util.cipher.ProtocolTicketCipherExecutor) EncryptionJwtSigningJwtCryptographyProperties(org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

EncryptionJwtSigningJwtCryptographyProperties (org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties)1 ProtocolTicketCipherExecutor (org.apereo.cas.util.cipher.ProtocolTicketCipherExecutor)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1