Java Code Examples for org.apache.shiro.web.mgt.CookieRememberMeManager#setDecryptionCipherKey()

The following examples show how to use org.apache.shiro.web.mgt.CookieRememberMeManager#setDecryptionCipherKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShiroAutoConfiguration.java    From spring-boot-shiro with Apache License 2.0 6 votes vote down vote up
@Bean
@ConditionalOnMissingBean(RememberMeManager.class)
public RememberMeManager rememberMeManager(Cookie cookie) {
    CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager();
    cookieRememberMeManager.setCookie(cookie);
    cookieRememberMeManager.setCipherService(cipherService);
    if (shiroCookieProperties.getCipherKey() != null) {
        cookieRememberMeManager.setCipherKey(shiroCookieProperties.getCipherKey().getBytes());
    } else {
        if (shiroCookieProperties.getEncryptionCipherKey() != null) {
            cookieRememberMeManager.setEncryptionCipherKey(shiroCookieProperties.getEncryptionCipherKey().getBytes());
        }
        if (shiroCookieProperties.getDecryptionCipherKey() != null) {
            cookieRememberMeManager.setDecryptionCipherKey(shiroCookieProperties.getDecryptionCipherKey().getBytes());
        }
    }
    cookieRememberMeManager.setSerializer(serializer);
    return cookieRememberMeManager;
}
 
Example 2
Source File: ShiroAutoConfiguration.java    From utils with Apache License 2.0 6 votes vote down vote up
@Bean
@ConditionalOnMissingBean(RememberMeManager.class)
public RememberMeManager rememberMeManager(Cookie cookie) {
    CookieRememberMeManager manager = new CookieRememberMeManager();
    manager.setCookie(cookie);
    manager.setCipherService(cipherService);
    if (null != shiroCookieProperties.getCipherKey()) {
        manager.setCipherKey(shiroCookieProperties.getCipherKey().getBytes());
    } else {
        if (null != shiroCookieProperties.getEncryptionCipherKey()) {
            manager.setEncryptionCipherKey(shiroCookieProperties.getEncryptionCipherKey().getBytes());
        }
        if (null != shiroCookieProperties.getDecryptionCipherKey()) {
            manager.setDecryptionCipherKey(shiroCookieProperties.getDecryptionCipherKey().getBytes());
        }
    }
    manager.setSerializer(serializer);

    return manager;
}