当前位置: 首页>>代码示例>>Java>>正文


Java HashedCredentialsMatcher.setHashAlgorithmName方法代码示例

本文整理汇总了Java中org.apache.shiro.authc.credential.HashedCredentialsMatcher.setHashAlgorithmName方法的典型用法代码示例。如果您正苦于以下问题:Java HashedCredentialsMatcher.setHashAlgorithmName方法的具体用法?Java HashedCredentialsMatcher.setHashAlgorithmName怎么用?Java HashedCredentialsMatcher.setHashAlgorithmName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.shiro.authc.credential.HashedCredentialsMatcher的用法示例。


在下文中一共展示了HashedCredentialsMatcher.setHashAlgorithmName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setCredentialMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入方法依赖的package包/类
/**
 * 用户的登录的明文密码,先经过md5加密再和数据库比对
 */
@PostConstruct
public void setCredentialMatcher() {
	HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
	credentialsMatcher.setHashAlgorithmName("MD5");
	credentialsMatcher.setHashIterations(1024);
	setCredentialsMatcher(credentialsMatcher);
}
 
开发者ID:MarchMachao,项目名称:ZHFS-WEB,代码行数:11,代码来源:MyRealm.java

示例2: hashedCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入方法依赖的package包/类
/**
 * HashCredentialsMatcher,对密码进行编码
 */
@Bean(name = "hashCredentialsMatcher")
public HashedCredentialsMatcher hashedCredentialsMatcher(){
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName("MD5");
    credentialsMatcher.setHashIterations(2); //散列两次
    credentialsMatcher.setStoredCredentialsHexEncoded(true);
    return credentialsMatcher;
}
 
开发者ID:ZhuXS,项目名称:Spring-Shiro-Spark,代码行数:12,代码来源:ShiroConfig.java

示例3: jdbcRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入方法依赖的package包/类
@Bean(name = "jdbcRealm")
@DependsOn("lifecycleBeanPostProcessor")
public JdbcRealm jdbcRealm() {
    JdbcRealm realm = new JdbcRealm();
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName(Sha256Hash.ALGORITHM_NAME);
    realm.setCredentialsMatcher(credentialsMatcher);
    realm.setDataSource(dataSource);
    realm.init();
    return realm;
}
 
开发者ID:mraible,项目名称:java-webapp-security-examples,代码行数:12,代码来源:WebSecurityConfig.java

示例4: provideCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入方法依赖的package包/类
/**
 * When annotations activated, you'll need to hash passwords in your configured Realm (i.e.: shiro.ini file)
 * @return credentialsMatcher singleton implementation for this application
 */
//@Provides
//@Singleton
public CredentialsMatcher provideCredentialsMatcher(){
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher();
	matcher.setHashAlgorithmName(CREDENTIALS_MATCHER_ALGORITHM_NAME);
	return matcher;
}
 
开发者ID:pabiagioli,项目名称:secure-rest-webapp-archetype,代码行数:12,代码来源:BootstrapShiroModule.java

示例5: provideCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入方法依赖的package包/类
/**
 * When annotations activated, you'll need to hash passwords in your configured Realm (i.e.: shiro.ini file)
 * @return credentialsMatcher singleton implementation for this application
 */
//@Provides
//@Singleton
public CredentialsMatcher provideCredentialsMatcher(){
	logger.entry();
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher();
	matcher.setHashAlgorithmName(CREDENTIALS_MATCHER_ALGORITHM_NAME);
	logger.exit(matcher);
	return matcher;
}
 
开发者ID:pabiagioli,项目名称:shiro-guice-async-webapp,代码行数:14,代码来源:BootstrapShiroModule.java


注:本文中的org.apache.shiro.authc.credential.HashedCredentialsMatcher.setHashAlgorithmName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。